Control Plane Load Balancing
Configuring a load balancer in front of your control plane allows your cluster to stay responsive during both unplanned (node crashes) and planned (node restarts during upgrades) outages.
#
Configuring a control plane load balancer in WKPWhile following the creating a cluster on SSH Nodes instructions you can provide the public IP Address of your load balancer in the wksConfig.controlPlaneLbAddress
field. The load balancer should route all :6443
traffic to the internal IPs of the master
nodes specified in wksConfig.machines
.
#
An external load balancer example using HA ProxyOne setup is to use HA Proxy as the load balancer on a machine external to the cluster itself but still on the same network. We'll go through how to install and setup haproxy on a CentOS 7 machine.
Given we're following the creating a cluster on SSH Nodes instructions and have specified the IPs of a 3 master and 2 worker cluster like so:
and we have another machine that will run haproxy and be our load balancer.
ssh to the load balancer machine to install haproxy
Install haproxy with
Edit
/etc/haproxy/haproxy.cfg
setting thebackend kubernetes
IP addresses to your masters' private IPs.Restart haproxy with
Check that its running with
ps aux | grep haproxy
, if its not running see if its complaining about anything in particularjournalctl -u haproxy
. If its having trouble binding to a socket you might have to relax the SE restrictions withsudo setsebool -P haproxy_connect_any=1
Monitor the load balancer using the stats UI at the load balancer's public IP, in this case: http://35.190.222.1:8404/stats (Note the
/stats
!/
will give you a 503)
Your new load balancer should be ready for action.
Continue following the creating a cluster on SSH Nodes instructions, updating your config.yaml
with the load balancer's public IP: