Closed mleneveut closed 3 months ago
I fixed the deployment problem with this ingress code :
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: bff-ingress
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/connection-draining: "true"
appgw.ingress.kubernetes.io/connection-draining-timeout: "30"
appgw.ingress.kubernetes.io/backend-path-prefix: "/"
spec:
tls:
- hosts:
- contoso.com
secretName: tls-secret
rules:
- host: contoso.com
http:
paths:
- path: /my-url-context/api/*
pathType: Prefix
backend:
service:
name: service
port:
number: 80
but not sure it does what I want. I want to access the service with an URL like contoso.com/my-url-context/api/my-endpoint and that the service sees/receives an URL /my-endpoint
Hello mleneveut, Please remove the following annotation: appgw.ingress.kubernetes.io/backend-path-prefix: "/" It should resolve your issue.
Hey i have the same issue. My ingress file looks like this
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
creationTimestamp: null
name: appgwapp
annotations:
kubernetes.io/ingress.class: azure/application-gateway
spec:
rules:
- http:
paths:
- path: /pentests/appgw/*
pathType: Prefix
backend:
service:
name: appgwapp
port:
number: 8080
My app listens on /hello and /hello/buddy and i want to access it through my gateway through /pentests/appgw/hello or /pentests/appgw/hello/buddy. I tested it and its not working. Any idea why?
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: creationTimestamp: null name: appgwapp annotations: kubernetes.io/ingress.class: azure/application-gateway spec: rules:
- http: paths:
- path: /pentests/appgw/* pathType: Prefix backend: service: name: appgwapp port: number: 8080
You can try this:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
creationTimestamp: null
name: appgwapp
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/backend-path-prefix: "/"
spec:
rules:
- http:
paths:
- path: /pentests/appgw/*
pathType: Prefix
backend:
service:
name: appgwapp
port:
number: 8080
This should work for you.
Also remember that you must have readinessProbe and livenessProbe configured in your deployments.
Describe the bug Following the ingress doc, I'm trying to create an ingress with URL /api/xxx being forwarded to the pod with just /xxx https://docs.microsoft.com/fr-fr/azure/aks/ingress-basic
So I added a nginx.ingress.kubernetes.io/rewrite-target: /$2 and a pathRule containing /api(/|$)(.*)
I get an error :
To Reproduce Try to create the following ingress :
Ingress Controller details