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
- Open the Droplets page on DigialOcean and select the
ambimax-intern-k8s-*Droplet to copy the new private IP of the cluster. - Go to the "Access" section of the load balancer droplet: ambimax-intern-k8s-lb.
- Open a connection to the droplet via the "Recovery Console" feature. Credentials are stored in the LastPass entry "Login ambimax-intern-k8s-lb root".
- Open the
nginx.confwithnano /etc/nginx/nginx.confand 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 from10.114.0.3:32080to10.114.0.4:32080or vice versa. - Save and close the file with
CTRL + O,CTRL + MandCTRL + X. - Restart nginx with
service nginx restart.
Now all services should be available again.