<p>Exposing Service from a BareMetal(Kubeadm) Build Kubernetes Cluster to the outside world. I am trying to access my Nginx as a service outside of the cluster to get NGINX output in the web browser.</p>
<p>For that, I have created a deployment and service for NGINX as shown below, <a href="https://i.stack.imgur.com/2Gk93.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Gk93.png" alt="enter image description here" /></a></p>
<p>As per my search, found that we have below to expose to outside world</p>
<ul>
<li>MetalLb</li>
<li>Ingress NGINX</li>
<li>Some HELM resources</li>
</ul>
<p>I would like to know all these 3 or any more approaches in such way it help me to learn new things.</p>
<p><code>GOAL</code></p>
<ul>
<li>Exposing Service from a BareMetal(Kubeadm) Built Kubernetes Cluster to the outside world.</li>
<li>How Can I make my service has its own public IP to access from the outside cluster?</li>
</ul>

Abdul Gaffoor Noor Basha
<p>You need to deploy an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">ingress controller</a> in your cluster so that it gives you an entrypoint where your applications can be accessed. Traditionally, in a cloud native environment it would automatically provision a LoadBalancer for you that will read the rules you define inside your <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a> object and route your request to the appropriate service.</p>
<p>One of the most commonly used ingress controller is the <a href="https://docs.nginx.com/nginx-ingress-controller/" rel="nofollow noreferrer">Nginx Ingress Controller</a>. There are multiple ways you can use to deploy it (mainfests, helm, operators). In case of bare metal clusters, there are multiple considerations which you can read <a href="https://github.com/kubernetes/ingress-nginx/blob/main/docs/deploy/baremetal.md" rel="nofollow noreferrer">here</a>.</p>
<p>MetalLB is still in beta stage so its your choice if you want to use. If you don't have a hard requirement to expose the ingress controller as a LoadBalancer, you can <a href="https://github.com/kubernetes/ingress-nginx/blob/main/docs/deploy/baremetal.md#over-a-nodeport-service" rel="nofollow noreferrer">expose it as a NodePort Service</a> that will accessible across all your nodes in the cluster. You can then map that NodePort Service in your DNS so that the ingress rules are evaluated.</p>
