Comments (10)
Hm, I think we're mixing up things a bit here.
What @philipp-durrer-jarowa asks for is the ability to have just one Ingress resource per domain (IIRC we are kind of enforcing that somewhere during validations anyway) with different backends separated by path.
In their use case each of those backends requires its own rewrite configuration. Some example requests:
http://first-tenant.great-service.com/anything
-> http://frontend-service/anything
http://first-tenant.great-service.com/api/anything
-> http://service-backend/anything
http://first-tenant.great-service.com/static/anything
-> http://data-backend/first-tenant/anything
If that's correct, I do not think it's related to the chart but more to how we're rendering rewrites in locations.
from ingress-nginx.
This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from ingress-nginx.
And you are already using this https://kubernetes.github.io/ingress-nginx/examples/rewrite/ ?
from ingress-nginx.
Yes but we'd like to have only one ingress resource per domain, but there are multiple services behind it that need different rewrites. Example:
...
- host: "{{ $tenant }}.{{ .host }}"
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: {{ $fullName }}-frontend
port:
name: http-fe
- path: "/api/" ---> needs a rewrite to /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-backend
port:
name: http
- path: "/static" ---> needs a rewrite to /$tenant/static/
pathType: Prefix
backend:
service:
name: {{ $fullName }}-data
port:
name: http-fe
...
With the nginx.org/rewrites
I could do this:
nginx.org/rewrites: "serviceName={{ $fullName }}-backend rewrite=/; serviceName={{ $fullName }}-data rewrite=/{{ $tenant }}/static;"
from ingress-nginx.
Thanks for clarifying.
from ingress-nginx.
/assign @Gacko
I will leave this up to @Gacko, but this would be a breaking change for all other uses. The two projects are different, so annotations should reflect that.
from ingress-nginx.
It seems like this controller's one annotation will perform a single rewrite of the target-path to all rules in that ingress.
But what is @philipp-durrer-jarowa is asking is a combo like ;
- one annotation
- multiple rewrite operations defined in the value part of that one single annotation (new ability)
And @Gacko's example is showing a 2nd new ability of even having option to pick different backends for different rewrite operations, all in the same annotation
from ingress-nginx.
And @Gacko's example is showing a 2nd new ability of even having option to pick different backends for different rewrite operations, all in the same annotation
That is already covered by the rules matching the according paths.
What's not yet covered is the ability to specify a rewrite rule per backend. So in case a requests gets sent to backend A, apply rewrite rule A, if backend b then rewrite rule B and in all the other cases either do nothing or apply a general rewrite rule.
I really don't wanna over-engineer things, but that's how I understand the NGINX Inc. documentation.
from ingress-nginx.
This will be a feature for support in HTTP routes https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/
We are working on gateway API support and cannot implement this issue in ingress.
/close
from ingress-nginx.
@strongjz: Closing this issue.
In response to this:
This will be a feature for support in HTTP routes https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/
We are working on gateway API support and cannot implement this issue in ingress.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from ingress-nginx.
Related Issues (20)
- ACME challenge fails with `nginx.ingress.kubernetes.io/permanent-redirect` HOT 13
- Annotation whitelist-source-range not using client real IP HOT 8
- geoip2 enabling causes crash of controller v1.10 HOT 17
- Custom error_page redirects not working HOT 1
- The ingress-nginx controller crashes due to `unknown directive "alias"` when using global snippets. HOT 5
- Custom error_page redirects not working HOT 3
- Not able to install ingress-nginx helm chart in private AKS clusters HOT 6
- Ingress Test Fails to Route Traffic to a Deployment in Browser HOT 3
- Removing NET_BIND_SERVICE cap from ingres-nginx as part of nonroot, ingress pod in crashlooopbackoff HOT 3
- 499 reflect on service HOT 14
- Same Path, multiple ports HOT 3
- Nginx ingress being proxied by cloudflare results in sporadic 520 using http2 to origin HOT 4
- Add plugin hook for adding new load balancing algorithms HOT 2
- DNS errors cause global-rate-limit-memcached-connect-timeout to not be respected. HOT 12
- Nginx Ingress: Helm chart not able to find the opentracing variable declared HOT 2
- Custom-Headers annotation not working with 1.10.1 (changes are visible in git tag for 1.10.1) HOT 13
- use affinity for nginx & backend pods by useage of commonLabels HOT 2
- Better support for Helm installs HOT 3
- Ingress returning 503s when using Topology Aware Routing and the controller has no endpoints in the zone HOT 5
- Stop using testrunner image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ingress-nginx.