<p><strong>For your first question:</strong></p>

<blockquote>
  <p>When using a Kubernetes LoadBalancer or Ingress, is the normal
  NodePort used as the underlying connection point?</p>
</blockquote>

<p>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.</p>

<p><strong>For your question on the usage of NodePorts:</strong></p>

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

<p>The longer answer is that <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="nofollow noreferrer">NodePorts</a> are great for debugging and development but have some issues in production:</p>

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

<p>However, NodePorts do provide some nice flexibility (from <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">Kubernetes documentation</a>):</p>

<blockquote>
  <p>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.</p>
</blockquote>

CC BY-SA 4.0
2019-09-25T02:50:42.850Z
2019-09-25T02:50:42.850Z
Wesley Rolnick
<p>When using a Kubernetes <code>LoadBalancer</code> or <code>Ingress</code>, is the normal <code>NodePort</code> used as the underlying connection point? I.e. does the external-to-kubernetes load balancer implementation (used even when <code>Ingress</code> is in play) communicate with the <code>Service</code> in the cluster via <code>NodePort</code> or is there some other "magic" way that is used?</p>

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

<kubernetes><ingress>
Does Kubernetes Ingress use NodePort?
Mark
# Does Kubernetes Ingress use NodePort?

(Asked by: username_0 on 2019-09-25)

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.

**Tags:** kubernetes, ingress


---

## 1 answers

### Answer by username_1 on 2019-09-25. Score: 2 | Accepted answer

**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](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) 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](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport)):

> 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.


---

