How to route azure application gateway to a service in different namespace?

Uday Kiran Reddy (ureddy) 91 Reputation points
2023-08-28T20:05:52.5366667+00:00

My ingress for azure application gateway, so that it will use istio gateway internally.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: server-ingress
  namespace: productnamespace
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/backend-protocol: "http"
    appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
    cert-manager.io/cluster-issuer: letsencrypt-prod
    appgw.ingress.kubernetes.io/health-probe-status-codes: "200-399, 401, 403"
spec:
  tls:
  - hosts:
    - dev1.myproductnamespace.com
    secretName: productnamespace-cert-secret
  rules:
  - host: dev1.myproductnamespace.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          namespace: istio-system
          service:
            name: istio-gateway
            port:
              number: 80

istio-gateway is in istio-system namespace, And above ingress is in productnamespace. When I did port-forwarding for istio-gateway, it is able to access the product pages. So, istio gateway is good.

But route from azure app gateway ingress to istio-gateway ingress is failing.

In the events, it shows as below.

It is trying to search for istio-gateway in productnamespace instead of istio-system and failing.

User's image

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,063 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,101 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.