<p>For instance, I have a bare-metal cluster with 3 nodes ich with some instance exposing the port 105. In order to expose it on external Ip address I can define a service of type NodePort with &quot;externalIPs&quot; and it seems to work well. In the documentation it says to use a load balancer but I didn't get well why I have to use it and I worried to do some mistake.</p>

dred dred
<blockquote>
<p>Can somebody explain whay I have to use external (MetalLB, HAProxy etc) Load Balancer with Bare-metal kubernetes cluster?</p>
</blockquote>
<p>You don't have to use it, it's up to you to choose if you would like to use NodePort or LoadBalancer.</p>
<hr />
<p>Let's start with the difference between NodePort and LoadBalancer.</p>
<p><strong>NodePort</strong> is the most primitive way to get external traffic directly to your service. As the name implies, it opens a specific port on all the Nodes (the VMs), and any traffic that is sent to this port is forwarded to the service.</p>
<p><strong>LoadBalancer</strong> service is the standard way to expose a service to the internet. It gives you a single IP address that will forward all traffic to your service.</p>
<p>You can find more about that in kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">documentation</a>.</p>
<hr />
<p>As for the question you've asked in the comment, <code>But NodePort with &quot;externalIPs&quot; option is doing exactly the same. I see only one tiny difference is that the IP should be owned by one of the cluster machin. So where is the profit of using a loadBalancer?</code> let me answer that more precisely.</p>
<p>There are the <a href="https://medium.com/avmconsulting-blog/external-ip-service-type-for-kubernetes-ec2073ef5442" rel="nofollow noreferrer">advantages &amp; disadvantages</a> of ExternalIP:</p>
<blockquote>
<p>The <strong>advantages</strong> of using <strong>ExternalIP</strong> is:</p>
<p>You have full control of the IP that you use. You can use IP that belongs to your ASN &gt;instead of a cloud provider’s ASN.</p>
<p>The <strong>disadvantages</strong> of using <strong>ExternalIP</strong> is:</p>
<p>The simple setup that we will go thru right now is NOT highly available. That means if the node dies, the service is no longer reachable and you’ll need to manually remediate the issue.</p>
<p>There is some manual work that needs to be done to manage the IPs. The IPs are not dynamically provisioned for you thus it requires manual human intervention</p>
</blockquote>
<hr />
<p>Summarizing the pros and cons of both, we can conclude that ExternalIP is not made for a production environment, it's not highly available, if node dies the service will be no longer reachable and you will have to manually fix that.</p>
<p>With a LoadBalancer if node dies the service will be recreated automatically on another node. So it's dynamically provisioned and there is no need to configure it manually like with the ExternalIP.</p>
