Load Balancer from Kubernetes is unstable

Posted April 3, 2019 4.1k views
Load BalancingKubernetes

I have a Kubernetes cluster with two nodes. I’m trying to deploy a Wordpress installation using yaml configs with:

  • 1 MariaDB pod with its service
  • 1 Wordpress pod
  • 1 Load Balancer service targeting Wordpress

Every configuration are well applied and a Load Balancer is created in my DO account targeting the two nodes of my cluster on the right NodePort. After a long time, the LB is still in an unhealthy status. When I try to fetch the IP address allocated to the LB, sometimes it works (about 90%), sometimes it doesn’t (about 10%).

I tried to remove one of the two nodes but no changes.

Did I miss something ? Wordpress is reached but why the configuration is unstable ?

Thank you for your help

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

Thanks for your response.
Health checks were good and the ingress controller is provided by Digital Ocean.
My problem was in the configuration of my LB service: I’ve fixed externalTrafficPolicy: Local in my service for a correct routing to my pods and it works.

Check that the health-check port (in LoadBalancer settings) is the same as your NodePort so the LoadBalancer can test the state of the service.

Also, have you got an ingress controller like: to route traffic to the correct services?