Load Balancer not forwarding to kubernetes service on nodePort.

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?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I have the same error

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.