I have set up an asp.net application in aks almost similar to this article: https://techcommunity.microsoft.com/t5/fasttrack-for-azure/what-does-it-mean-for-the-application-gateway-ingress-controller/ba-p/2839051
Used helm chart instead so I can do a helm upgrade --install my-deployment my-chart
instead.
While the App Gateway is associated ok with the aks instance, one issue is the rule is getting associated with the defaultaddresspool and not the newly created backend target and settings from the chart / ingress. I can manually change it in the dropdown but that's not practical with multiple services and one helm chart deploy resets every service rule's association to the defaultaddresspool.
Can anyone suggest anything obvious I might be missing?
Thanks @YK, your comment had me investigate further. Turns out I had misconfigured the spec rules
I had
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/backend-hostname: <<name>>
spec:
rules:
- host: <<name>>
http:
paths:
- path: /swagger/index.html
pathType: Exact
backend:
service:
name: {{ .Release.Name }}
port:
number: 80
because the swagger endpoint was needed for health check
Changing that to
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
annotations:
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/backend-hostname: <<name>>
appgw.ingress.kubernetes.io/health-probe-path: "/swagger/index.html"
spec:
rules:
- host: <<name>>
http:
paths:
- path: /
pathType: Exact
backend:
service:
name: {{ .Release.Name }}
port:
number: 80
corrected it.