I would like to avoid using type: "LoadBalancer"
for a certain Kubernetes Service, but still to be able to publish it on the Internet. I am using Google Cloud Platform (GCP) to run a Kubernetes cluster currently running on a single node.
I tried to us the externalIPs
Service configuration and to give at turns, the IPs of:
kubernetes describe node
)LoadBalancer
running on the same node.None of the above helped me reach my application using the Kubernetes Service with an externalIPs
configuration.
So, how can I publish a service on the Internet without using a LoadBalancer
-type Kubernetes Service.
There's another option: set the hostNetwork
flag on your pod.
For example, you can use helm3 to install nginx this way:
helm install --set controller.hostNetwork=true nginx-ingress nginx-stable/nginx-ingress
The nginx is then available at port 80 & 443 on the IP address of the node that runs the pod. You can use node selectors or affinity or other tools to influence this choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With