Sorry, not sure I follow.
Can you share how you installed the ingress controller? Like which guide?
Usually, you get a node balancer service for your Ingress and then that routes to the right services (not type load balancer). I think that is the most common setup.
Thanks for your reply.
I followed this guide to setup Ingress with Nginx controller:
https://cloud.google.com/community/tutorials/nginx-ingress-gke
My question is, why does creating an ingress resource yield a new public IP address.
After following the guide in the link above, I get an “nginx-ingress-controller” of type LoadBalancer with a public IP address and that’s to be expected, but when I create an ingress resource in YAML to customize ingress paths, I see a new public IP address (still not accessible on port 80) when I do “kubectl get ingress”.
This is the YAML for the ingress resource:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: express-app-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /api
backend:
serviceName: express-app-service
servicePort: 80
IIUC, the IP is just the load balancer to route traffic to your nginx.
You need traffic to be routed to your Ingress, and the IP is the way to have it.
The service you expose behind the Ingress just needs to be type clusterIP, so it won’t create any other load balancer nor anything.
The setup is: all traffic is routed to this Ingress nginx and then it decided to which service serve the traffic to.
Does it make sense now?