Load Balancer not forwarding to kubernetes service on nodePort.

Posted April 1, 2018 7.8k views
CoreOSLoad BalancingKubernetes

Hi there,

I run a kubernetes cluster on Digital Ocean.

I created a service, which is exposed via type nodePort. I can access the service in my browser if I enter http://PublicNodeIp:31433.

Now I want to use a DigitalOcean Load Balancer to forward traffic from port 80 to the service, but it doesn’t work. If I enter the load balancer IP in the browser I get: 503 Service Unavailable.

The load balancer is configured to forward http port 80 to Droplet http port 31433

I’m not sure, but can it be that the Load Balancer doesn’t forward to the Public Droplet Ip? If this is the problem, how can I expose a Kubernetes Service using the Private Droplet Ip?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

What you are describing should work normally via the public IP address, however, Load Balancers default to using the private network if private networking is enabled on the target Droplets. In this case, since you are using Kubernetes, I assume private networking is enabled.

I recommend that you expose the service on the private IP address instead and check back.

I have the same error

by Hanif Jetha
In this tutorial, learn how to set up and secure an Nginx Ingress Controller with Cert-Manager on DigitalOcean Kubernetes.