AGIC brownfield deployment, 2 AKS clusters and common (shared) App Gateway. Both clusters having the exact same Ingress and Service definitions. This resulted in a single rule and a single backend pool in the app gw, while there should've been obviously two rules and two backend pools (one of each for each of the two clusters).
Production Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: services-recruitment-api-prod
namespace: services-recruitment
annotations:
appgw.ingress.kubernetes.io/ssl-redirect: "false"
appgw.ingress.kubernetes.io/hostname-extension: "prod-XXX.XXX.XX"
appgw.ingress.kubernetes.io/backend-hostname: "prod-XXX.XXX.XX"
spec:
ingressClassName: azure-application-gateway
rules:
- host: prod-XXX.XXX.XX
http:
paths:
- path: /Recruitment/swagger/
pathType: Prefix
backend:
service:
name: recruitment-api-s
port:
number: 80
Dev Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: services-recruitment-api
namespace: services-recruitment
annotations:
appgw.ingress.kubernetes.io/ssl-redirect: "false"
appgw.ingress.kubernetes.io/hostname-extension: "dev-XXX.XXX.XX"
appgw.ingress.kubernetes.io/backend-hostname: "dev-XXX.XXX.XX"
spec:
ingressClassName: azure-application-gateway
rules:
- host: dev-XXX.XXX.XX
http:
paths:
- path: /Recruitment/swagger/
pathType: Prefix
backend:
service:
name: recruitment-api-s
port:
number: 80
APP GATEWAY:
AGIC created for the same backend pool two rules but with one target which pointed to IP address of the second AKS cluster.
If there is any way to somehow add prefix or rename backend pool using annotations? Because whatever will be done manually on App Gateway level, will be overridden by AGIC automatically.