<p>I have 1 master and 2 worker on my k8s cluster.It's bare metal and I can't use any of cloud providers. I just can use DNS load balancer. I want to expose valid ports (like 80 and 443) on my nodes because of that I can't use NodePort. What is the best solution?</p>
<p>My only solution was to install Nginx on all of my nodes and proxy ports to my ClusterIp services.I don't know that this is a good solution or not.</p>
<p><a href="https://i.stack.imgur.com/xldfX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xldfX.jpg" alt="enter image description here" /></a></p>

heydar dasoomi
<p>Following things that you are doing right :</p>
<ol>
<li>Cluster IP service - If you don't want to expose your services to be invoked form outside the cluster, CLusterIP is right way instead of NodePort or LoadBalancer.</li>
</ol>
<p>Following things that you can do:</p>
<ol>
<li>Create an Ingress Controller and and Ingress resource for your cluster which will listen on port 80 and 443 and proxy the requests to your services according to routes mentioned in the ingress.</li>
<li>You can create inginx-ingress controller using link: <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/</a></li>
<li>Then create an Ingress resource using link <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></li>
</ol>
