I have this application I'm toying with. It consists of a Deployment
(web
with 3 instances running) with a Service
exposing it (web-service
). Right now the Service
is of type LoadBalancer
. I also added a Ingress
directive to route my traffic as desired.
My question is...with the Ingress
in place, should I switch the service type from LoadBalancer
to NodePort
or I should leave it in the same state?
From the documentation I have read so far it seems to be the general concensus to avoid nodePort
as it is allocating ports on the physical (or virtual) nodes and that can become crowded after a time. Having a LoadBalancer
automatically exposes a free port that the Google L3 Loadbalancer routes traffic to so no need to switch this to Nodeport.
Also note - once you have a working Ingress you don't need to expose the backend service as a LoadBalancer
or NodePort
at all - a normal internal kind: Service
is enough to receive traffic from the Ingress
.