Reset load balancer droplet

Introduction

Since a load balancer costs not a little money, a former employee decided to create an own load balancer for the ambimax-intern cluster at the cost of a droplet. This load balancer droplet has the private IP of the cluster hard coded in /etc/nginx/nginx.conf.

If no app or service in the ambimax-intern cluster is available and returns a nginx "Bad Gateway" page with a nginx version of 1.18.0 (at the moment of the writing), this how-to is the right one. The cluster has been recreated, the Kubernetes version has been upgraded or something else, so the private IP has changed.

With the help of this how-to you will be able to reset the private IP in the /etc/nginx/nginx.conf of the load balancer droplet.

Steps

  1. Open the Droplets page on DigialOcean and select the ambimax-intern-k8s-* Droplet to copy the new private IP of the cluster.
  2. Go to the "Access" section of the load balancer droplet: ambimax-intern-k8s-lb.
  3. Open a connection to the droplet via the "Recovery Console" feature. Credentials are stored in the LastPass entry "Login ambimax-intern-k8s-lb root".
  4. Open the nginx.conf with nano /etc/nginx/nginx.conf and adjust the IP of the cluster upstream to the new private IP of the cluster from the first step. Often it is just a switch from 10.114.0.3:32080 to 10.114.0.4:32080 or vice versa.
  5. Save and close the file with CTRL + O, CTRL + M and CTRL + X.
  6. Restart nginx with service nginx restart.

Now all services should be available again.