Only path / works in AKS ingress

Viewed 67

I surfed on many websites, stackoverflow post and others but cannot find the workaround. Using AKS 1.23.8 and Ingress installed with helm install ingress nginx-stable/nginx-ingress --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz --set controller.service.externalTrafficPolicy=Local

and this is the multiple paths ingress rule :

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: az-ingress
spec:
  ingressClassName: nginx
  rules:
  - host: k8s.test.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: azure-vote-front
            port: 
              number: 80
      - path: /hello
        pathType: Prefix
        backend:
          service:
            name: hello-world-service
            port: 
              number: 80

Which was showed in this post : Why only / path works in AKS with NGINX Ingress Controller and https://github.com/Azure/AKS/issues/2907 Path / works but path /hello return Cannot GET /hello

If i use different host for each service, it works like a charm :

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: az-ingress
spec:
  ingressClassName: nginx
  rules:
  - host: k8s.test.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: azure-vote-front
            port: 
              number: 80
  - host: k8s.test2.example.com
    http:
      paths:            
      - path: /
        pathType: Prefix
        backend:
          service:
            name: hello-world-service
            port: 
              number: 80

what could be the issue ?

This is the log : enter image description here

1 Answers

Hows your luck if you try "pathType: Exact" for /hello

Related