<p>I am trying to host a simple html static site on kubernetes and was able to set everything working as expected but when I used <strong>load balancer</strong> in the service its exposed to public.</p>
<p>I tried to use <strong>nodeport</strong> option but our node dont have public IP to access it.</p>
<p>With just custer IP Iam unable to access it as well.</p>
<p>How do we host site only internally and which approach is the right one.</p>
<p>I started to look in to ingress controllers but then could not ways to install it to use it.</p>
<p>Any help is appreciated.</p>

mamidala86
<p>Posting this answer as a community wiki to give more of a baseline approach and to point to the possible solutions.</p>
<p>Feel free to edit/expand.</p>
<hr />
<p>Answering the question from the title:</p>
<blockquote>
<p>How do I host a simple html code on kubernetes within our network?</p>
</blockquote>
<p>This question is mainly related to the <code>Services</code> and how they work. Assuming that you already have a <code>Deployment</code> with it, the best course of actions would be to reach to the documentation of your cloud provider on the support of various <code>Services</code> and how you can connect to them. In general you would connect to this <code>Deployment</code> (with some <code>html</code> code) either by:</p>
<ul>
<li><code>Service</code> of type <code>NodePort</code> - port (<code>30000</code>-<code>32767</code>) on each <code>Node</code> will be opened for accessing the <code>Deployment</code></li>
<li><code>Service</code> of type <code>LoadBalancer</code> - IP address will be requested for the <code>Service</code> which you can access to get to the <code>Deployment</code> (can be <strong>internal</strong> or external)</li>
</ul>
<hr />
<p>As this topic is related to cloud-managed solutions and it's requirement is to connect to the <code>Service</code> from the network hosted by a cloud-provider, I'd reckon one of the solutions would be to look for objects like:</p>
<ul>
<li><em>Internal Ingress</em></li>
<li><em>Internal LoadBalancer</em></li>
</ul>
<p>This objects will be created in a way that you could access them only from the internal network (which I'm assuming you are connected to with your <code>VPN</code>).</p>
<p>Examples of such implementations across some cloud providers:</p>
<ul>
<li><code>GKE</code>: <em><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="nofollow noreferrer">Cloud.google.com: Kubernetes Engine: Docs: How to: Internal load balancing</a></em></li>
<li><code>EKS</code>: <em><a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html" rel="nofollow noreferrer">Docs.aws.amazon.com: Latest: Userguide: Network load balancing</a></em></li>
<li><code>AKS</code>: <em><a href="https://learn.microsoft.com/en-us/azure/aks/internal-lb" rel="nofollow noreferrer">Docs.microsoft.com: Azure: AKS: Internal lb</a></em></li>
</ul>
<blockquote>
<p>A side note!</p>
<p>You can use <code>Service</code> of type <code>Loadbalancer</code> (internal one) to be the entrypoint for your <code>Ingress</code> controller like <code>ingress-nginx</code>:</p>
<ul>
<li><em><a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">Kubernetes.github.io: Ingress nginx: Deploy</a></em></li>
</ul>
</blockquote>
<hr />
<p>Additional resources:</p>
<ul>
<li><em><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Kubernetes.io: Docs: Concepts: Service networking: Service</a></em></li>
</ul>
