Kuberntes ingress works but does not display address

12/7/2021

I'm running 2 ingress-nginx controllers, one external and one internal, everything works, traffic is flowing, but for some reason my kubernetes ingress resource, doesn't display the address that the controller has

Every 2.0s: kubectl get ingress

NAME                     CLASS            HOSTS             ADDRESS   PORTS     AGE
my-app-external          nginx-external   my.app.com                  80, 443   21h

everything works, but it bothers me that the address is not displayed; my controllers are deployed properly

Every 2.0s: kubectl get services -n ingress-nginx

NAME                                          TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE
nginx-external-ingress-nginx-controller       LoadBalancer   10.191.93.78    <pub_ip>        80:30470/TCP,443:31251/TCP   10d
nginx-external-ingress-nginx-defaultbackend   ClusterIP      10.191.95.41    <none>          80/TCP                       10d
nginx-internal-ingress-nginx-controller       LoadBalancer   10.191.71.162   10.227.13.2     80:31858/TCP,443:30080/TCP   10d
nginx-internal-ingress-nginx-defaultbackend   ClusterIP      10.191.78.126   <none>          80/TCP                       10d

with values of ingress-nginx/ingress-nginx helm chart looking like this

# internal
controller:
  ingressClassResource:
    name: "nginx-internal"
    controllerValue: "k8s.io/internal-ingress-nginx"

  service:
    annotations:
      cloud.google.com/load-balancer-type: "Internal"
      networking.gke.io/internal-load-balancer-allow-global-access: "true"

and

# external
controller:
  ingressClassResource:
    name: "nginx-external"
    controllerValue: "k8s.io/external-ingress-nginx"

my kubernetes ingress resource looks like so

apiVersion: networking.k8s.io/v1
kind: Ingress
...
spec:
  ingressClassName: "nginx-external"

and my IngressClass'es look like this

Every 2.0s: kubectl get ingressclass

NAME             CONTROLLER                      PARAMETERS   AGE
nginx-external   k8s.io/external-ingress-nginx   <none>       21h
nginx-internal   k8s.io/internal-ingress-nginx   <none>       3d21h

and on top of that, before this change I was running external and internal ingress with same controllerValue so ingressclasses looked like this

Every 2.0s: kubectl get ingressclass                                       MacBook-Pro-5.local: Tue Dec  7 12:31:02 2021

NAME             CONTROLLER                      PARAMETERS   AGE
nginx-external   k8s.io/ingress-nginx   <none>       21h
nginx-internal   k8s.io/ingress-nginx   <none>       3d21h

and everything worked as well!!!!!, but the ingresses in that scenario displayed WRONG addresses and displayed that they talk to WRONG ingress controller; like this (notice external and internal both display external ip)

Every 2.0s: kubectl get ingress                                            MacBook-Pro-5.local: Tue Dec  7 12:33:30 2021

NAME                              CLASS            HOSTS                             ADDRESS         PORTS     AGE
tst-my-app-1                      nginx-external   tst-my.app.domain                 <pub_ip>        80, 443   180d
tst-my-app-2                      nginx-internal   tst-my.app2.domain                <pub_ip>        80        206d
...

and they worked properly!!, traffic was going how it was supposed to - from my point of view it was just a visual bug) - my question is, did anyone else encounter it as well ? or have any idea how to fix it and make kubernetes display the address that the ingress takes from controller properly?

-- CptDolphin
ingress-nginx
kubernetes
nginx

0 Answers