1

When using a Kubernetes LoadBalancer or Ingress, is the normal NodePort used as the underlying connection point? I.e. does the external-to-kubernetes load balancer implementation (used even when Ingress is in play) communicate with the Service in the cluster via NodePort or is there some other "magic" way that is used?

I ask because in reading about kubernetes, I have found some sources that have almost implied that NodePort is somehow unreliable ("if you don't need your services to be available all the time"), and if NodePort is the mechanism underlying other load balancer implementations, then it should be safe to use, given an understanding of its particularities.

2

For your first question:

When using a Kubernetes LoadBalancer or Ingress, is the normal NodePort used as the underlying connection point?

Technically it depends on the cloud network for LoadBalancers (e.g. Google Compute Engine does not technically require this although one may be created). However, I believe a NodePort and ClusterIP are generally created.

For your question on the usage of NodePorts:

The short answer is yes, they are safe to use if you know what you are doing.

The longer answer is that NodePorts are great for debugging and development but have some issues in production:

  • You can only have one service on a port.
  • HTTP/HTTPS traffic may be routed through a non-standard port.
  • The port will be opened on all nodes.

However, NodePorts do provide some nice flexibility (from Kubernetes documentation):

Using a NodePort gives you the freedom to set up your own load balancing solution, to configure environments that are not fully supported by Kubernetes, or even to just expose one or more nodes’ IPs directly.

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.