-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give control for the reverse proxy path #18
Comments
I'd suggest just using an arrow of |
I don't disagree but I do want it to be somewhat intuitive in that spaces matter so it can't be On a different note, I really wish we could break this up into an object but without a custom type, we either overload the value as serialized JSON or we continue with simple tokenization like have now. |
I'd like us to start with a definition of the problem we are solving. What are the customer scenarios? Why are people motivated to change paths, rather than passing them through? |
Some applications will be sensitive the the path it receives. Not only this but there is a discrepancy amongst proxies. For example, Apigee Edge will remove the proxy's base path from the target request while our router will not. Since we cannot predict how people will deploy applications to Kubernetes and we should not force applications be written to be deployed for Kubernetes, we should just let the application author configure how this themselves. |
I'd like to understand the customer's problem in more detail. Our ingress controller is designed to allow each namespace to appear on the outside as a single domain (e.g. acme.com), or possibly a set of related domains (e.g. acme.com and acme-canary-test.com). Within that domain, there are paths (e.g. /foo, /bar) that are mapped to deployments of "components". The obvious approach is that the "component" that handles /foo should implement /foo. We are proposing to allow the case where the "component" implements /baz, but it is exposed as /foo from the namespace. Why? Is it because we are reusing a legacy component that already implements /baz? Are we solving some other problem? [I'm not arguing that we don't need the feature—I just want to know why we need it.] |
I agree that if an application says it handles |
"sometimes [...] these public/private paths are really just used for namespacing". |
Well, if you have multiple applications for the same hostname, the |
If your goal is just to expose your application, why not just put it in its own namespace at '/'? Why mess with al this paths stuff at all? |
The point is that as a generic router, we have no right to tell an application author that they have to alter their application that runs just fine outside of Kubernetes, or in Kubernetes when accessed directly without our router, to update their application just so it plays well with the hard coded approach to routing paths that we have. I agree that in most cases, especially in a managed environment, we can assume one way but this is a generic router that has no concept of these things. That's why I think we can make our router the better by support this. |
Now you are saying things that I understand. The user scenario you are On Tue, Jun 14, 2016 at 3:21 PM, Jeremy Whitlock [email protected]
|
Glad I got us on the same page. Yes, that's the idea. And it came up quite a bit in our internal hackathon. When people were pointed to this as a potential answer, they were very happy with this. |
I don't really like this idea, because it only works in a narrow set of circumstances. Suppose, for example, that the application includes self-links in all resources (something all apps should do, IMO). In other words, if I POST an new resource to |
I agree that it won't work for everything but for the cases it does, it means the author not having to rewrite their client/server and/or contend with other tenants. I agree with you but in the cases where it does work, we're not hurting anything giving them more control. As long as we don't label this as a silver bullet that makes magic happen, it should be limited in scope and all the ownership and risk is on the application author and not us. |
The problem with that is that it is difficult to explain when it will and On Wed, Jun 15, 2016 at 9:42 AM, Jeremy Whitlock [email protected]
|
Ironic that I was arguing against this, and am now suggesting we do it :) In your original issue description, you said there are 3 cases, but I think Nginx models this as just 2 cases. The cases are:
I like your -> syntax. If we are using this syntax, would it not be more logical to put the port on the right? In other words, instead of writing |
You're right, the last two examples are really the same. Let me think about your proposed syntax and I'll get back to you. |
I like the original path on the left syntax, feels more intuitive. |
Right now, the generated nginx will retain the originally requested path when performing the reverse proxy to the k8s pod. We need a way to allow the user to configure this and here are three scenarios:
/nodejs/x
->/nodejs/x
/nodejs/x
->/x
/nodejs/x
->/java/x
The current
publicPaths
is in the form of{CONTAINER_PORT}:{PATH}
and to facilitate this, we could use{CONTAINER_PORT}:{PATH}[:{TARGET_PATH}]
. Here are examples to solve these use cases:3000:/nodejs
or3000:/nodejs:
3000:/nodejs:/
3000:/nodejs:/java
Since
:
is a valid URI character, the separator for the third optional part might need to be changed but this should illustrate the problem and suggested fix.The text was updated successfully, but these errors were encountered: