<p>We are trying to find and implement best practises for Kubernetes and LoadBalancer typed services.</p>

<p>We found an entry that an open NodePort is a bad-practise if you use a LoadBalancer.
Kubernetes now always creates a NodePort too, when we use <code>type: LoadBalancer</code></p>

<p><code>
service:
  type: LoadBalancer
  port: 30111
</code></p>

<p>I cannot find a hint in the documentation why this happens, if this is normal or how to avoid a NodePort here.</p>

<p>What's the reason Kubernetes always creates a NodePort too?</p>

Benjamin Abt
<p>It's a normal behavior.<br/>
From <a href="https://kubernetes.io/docs/concepts/services-networking/#publishing-services-service-types" rel="nofollow noreferrer">documentation</a>:</p>

<blockquote>
  <p>LoadBalancer: Exposes the service externally using a cloud provider’s load balancer. <strong>NodePort</strong> and <strong>ClusterIP</strong> services, to which the external load balancer will route, are automatically created.</p>
</blockquote>

<p>The problem configuring an external load balancer and a NodePort service type, is that you would be balancing requests between the nodes twice: one time at the external load balancer and another time at svc Kubernetes level.</p>

<p>As far as I know, using the LoadBalancer service type Kubernetes avoids doing this and at least in EKS uses the NodePort service for health check purposes (target groups).</p>
