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 load balancer in the service its exposed to public.
I tried to use nodeport option but our node dont have public IP to access it.
With just custer IP Iam unable to access it as well.
How do we host site only internally and which approach is the right one.
I started to look in to ingress controllers but then could not ways to install it to use it.
Any help is appreciated.
Posting this answer as a community wiki to give more of a baseline approach and to point to the possible solutions.
Feel free to edit/expand.
Answering the question from the title:
This question is mainly related to the
Services
and how they work. Assuming that you already have aDeployment
with it, the best course of actions would be to reach to the documentation of your cloud provider on the support of variousServices
and how you can connect to them. In general you would connect to thisDeployment
(with somehtml
code) either by:Service
of typeNodePort
- port (30000
-32767
) on eachNode
will be opened for accessing theDeployment
Service
of typeLoadBalancer
- IP address will be requested for theService
which you can access to get to theDeployment
(can be internal or external)As this topic is related to cloud-managed solutions and it's requirement is to connect to the
Service
from the network hosted by a cloud-provider, I'd reckon one of the solutions would be to look for objects like: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
VPN
).Examples of such implementations across some cloud providers:
GKE
: Cloud.google.com: Kubernetes Engine: Docs: How to: Internal load balancingEKS
: Docs.aws.amazon.com: Latest: Userguide: Network load balancingAKS
: Docs.microsoft.com: Azure: AKS: Internal lbAdditional resources: