feluxe
By:
feluxe

Load Balancer not forwarding to kubernetes service on nodePort.

April 1, 2018 182 views
Kubernetes Load Balancing CoreOS

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?

1 Answer

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.

Have another answer? Share your knowledge.