0

I have a GKE cluster running with the nginx-ingress controller from the Kubernetes community (via Helm). I set it up with a regional IP which I had reserved in advance like so:

helm install stable/nginx-ingress \
  --set controller.service.loadBalancerIP=my.reserved.regional.ip

I then added a couple of Ingress resources with the kubernetes.io/ingress.class: "nginx" annotation and nothing much else, and pointed them to a headless service in the cluster (a type: ClusterIP).

This works fine, and I can access the vhost-based ingresses via the load balancer IP.

However, I am wondering why the Ingress resources are also assigned an external IP:

==> v1beta1/Ingress
NAME           HOSTS                ADDRESS        PORTS  AGE
ingress-admin  admin.my-domain.com  35.195.255.71  80     24m
ingress-api    api.my-domain.com    35.195.255.71  80     24m

Is this normal? The IP responds to ping but does not serve HTTP (which my service does). Is there anything I need to do with the Ingress resources to avoid this?

0

Welcome @Achton on StackExchange.

To keep the same Reserved Static External IP Address in Ingress resources as assigned to Ingress Controller`s LB Service, you should set one more configuration parameter when installing nginx-ingress controller with helm chart, this is:

--set controller.publishService.enabled=true

as explained in NGINX Ingress Controller documentation here

| improve this answer | |
  • Thanks Nepomucen - is my service required to be of type LoadBalancer? Because I'm currently using only "headless" services (with "clusterIP: none"). – Achton May 7 '19 at 7:34
  • It should be of ClusterIP Type, if you want to expose services externally via Ingress Controller, backed with the same static LoadBalancer`s IP address. – Nepomucen May 7 '19 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.