Comments (18)
Currently, Application Gateway v2 doesn't support URL re-writes, so we will need to wait for Application Gateway v2 to add this support before we can introduce this in ingress controller.
from application-gateway-kubernetes-ingress.
How about the "Override Backend Path" feature?
Is that supported, @asridharan ?
from application-gateway-kubernetes-ingress.
@akshaysngupta had the same suggestion @knom . The problem with just using an override vs full re-write capabilities is that it is very restricted in its ability so we wanted to wait for the full re-write capabilities to land to introduce this. That said I do see the value in building this out incrementally by using the override feature as a segway to full URL re-write capabilities.
We will need to introduce annotations to introduce these overrides so will have to think a lot of about these annotations.
from application-gateway-kubernetes-ingress.
Thanks @asridharan!
WITHOUT rewrite or override..
Assuming you have two rules:
- /foo/ --> Backend 1
- /bar/ --> Backend 2
Am I correct that backend 1 would have to host the site under "/foo/" and backend 2 under "/bar/" as well (unless we have the rewriting?)
This seems broken, as it means you're tying the actual backend to the config of the gateway :-(
from application-gateway-kubernetes-ingress.
@knom I agree the current functionality is a bit restrictive and we want to fix it before we mark the ingress controller stable. Hence, we probably should support override
sooner rather than later since it brings it in parity with AG.
from application-gateway-kubernetes-ingress.
@knom #111 should fix this. Could you upgrade your helm to try this?
You will need to use the backen prefix annotation to use use the backend override in AG:
https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/annotations.md#backend-path-prefix
from application-gateway-kubernetes-ingress.
@asridharan - I've just bounced my deployment to use newest version of kubernetes-ingress
(0.2.0) but it doesn't seem to solve issue here.
My spec:
1 backend service (svc-a) with 2 endpoints:
- /ping
- /status
Ingress spec:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: svc-a-ingress
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/backend-path-prefix: "/a/"
spec:
rules:
- http:
paths:
- backend:
serviceName: svc-a
servicePort: 80
I got 404 when calling both:
Did I misunderstood purpose of #111 ?
from application-gateway-kubernetes-ingress.
@dkulig guess need to document this a bit better.
The annotation:
appgw.ingress.kubernetes.io/backend-path-prefix: "/a/"
Will just override your path rule in that ingress resource with the value of the annoation. So in your case, I guess "/" will get overriden by "/a/" and that's probably why you are getting a 404.
Question:
Are you able to hit the endpoints with just:
http://my-app-gw-uri/ping
and http://my-app-gw-uri/_status
since the ingress already sets up the "/" route?
from application-gateway-kubernetes-ingress.
@asridharan neither endpoint mentioned by you works. No matter what I try to hit I get 404.
I'd be grateful to get some explanation what should I expect with the setup I used.
from application-gateway-kubernetes-ingress.
@dkulig let me restate:
http://my-app-gw-uri/ping
and http://my-app-gw-uri/_status
should work without the backend prefix annotation to your resource. With the backend prefix annotation you have added:
appgw.ingress.kubernetes.io/backend-path-prefix: "/a/"
http://my-app-gw-uri/ping
I think would be sent to the backend as http://my-app-gw-uri/a/ping
which would fail. Also, http://my-app-gw-uri/a/ping
I think it would be re-written to http://my-app-gw-uri/a/a/ping
which would also fail.
Let me verify on my end that this is the behavior for /
path, but that's my thesis as to why this is not working. Does that help?
from application-gateway-kubernetes-ingress.
@asridharan
Yeah this is correct.
To clarify on my end, what I wanted to achieve is to prefix my services because I'll be running multiple backend services in cluster where every single service has mounted _status and ping endpoint on root ie.
- /_status
- /ping
therefore I'll be able to hit:
- http://my-app-gw-uri/service-a/_status
- http://my-app-gw-uri/service-a/_status
- http://my-app-gw-uri/service-b/ping
- http://my-app-gw-uri/service-b/ping
- ...
- ...
- etc..
from application-gateway-kubernetes-ingress.
I see. I think this ingress definition should work:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: svc-a-ingress
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/backend-path-prefix: "/"
spec:
rules:
- http:
paths:
- path: /service-a/
backend:
serviceName: svc-a
servicePort: 80
- path: /service-b/
backend:
serviceName: svc-b
servicePort: 80
Basically AG will override the URI http://my-app-gw-uri/service-a/
and http://my-app-gw-uri/service-b/
with http://my-app-gw-uri/
before forwarding it to the backend.
I think this ^^ is what you are looking for?
from application-gateway-kubernetes-ingress.
Awesome! To made it working I had to add *
after service name ie.
- path: /service-a/*
backend:
serviceName: svc-a
servicePort: 80
- path: /service-b/*
backend:
serviceName: svc-b
servicePort: 80
Thank you for clarification @asridharan
from application-gateway-kubernetes-ingress.
Awesome! To made it working I had to add
*
after service name ie.- path: /service-a/* backend: serviceName: svc-a servicePort: 80 - path: /service-b/* backend: serviceName: svc-b servicePort: 80
Thank you for clarification @asridharan
That's a bit odd. Thought the ingress path should be doing a simple prefix match. Great to see that the backend-prefix annotation is able to solve this case.
from application-gateway-kubernetes-ingress.
@dkulig would you mind augmenting the doc:
https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/annotations.md#backend-path-prefix
With an example. A PR would be super helpful here.
If not no worries, will do it some time later this week.
from application-gateway-kubernetes-ingress.
No worries, I'll do that later in the day
from application-gateway-kubernetes-ingress.
Closing this out.
from application-gateway-kubernetes-ingress.
the doc still says:
path: /hello/
instead of:
path: /hello/*
does not work without the /*
from application-gateway-kubernetes-ingress.
Related Issues (20)
- Public IP HTTPS fails when creating private IP HTTPS ingress HOT 3
- AGIC is cannot list resource "azureapplicationgatewayrewrites" in API group "appgw.ingress.azure.io" at the cluster scope HOT 15
- From ingress annotations, which one helps create backend pool in app gateway
- AGIC does not create dedicated pool & target for shared App Gateway HOT 1
- appgw support - Monitor managed Prometheus
- ingress appgw pod - forced restart necessary to create listener etc. for new frontend ip HOT 1
- [Help request] How to redirect from non-www to www site
- How to remove "defaulthttpsetting" because it raises security issue
- az cli command from install guide evaluates with empty value
- Unable to create AzureIngressProhibitedTarget on AKS HOT 2
- AGIC is wiping out my backend pools
- Terraform wipes out AGIC's backends on each deploy HOT 4
- 502 Bad Gateway and unhealthy probe in AGIC AppGW HOT 2
- AAD Pod Identity - archived and is no longer maintained. HOT 3
- Need to cretae a Application Gateway WAF policy resource lock enable policy
- Dualstack annotation
- ProhibitedTargets has incorrect path requirement HOT 1
- `appgw.ingress.kubernetes.io/appgw-ssl-profile` does not allow predefined ssl profiles HOT 1
- Application gateway redirects to value set in backend-hostname (used for SSL)
- OOM Killed ingress-appgw-deployment HOT 1
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 application-gateway-kubernetes-ingress.