Kubernetes - Control Plane
- haproxy: load balance HTTP requests.
haproxyhighly available; an implementation of VRRP.
ip will appear in
ip a s if the node is alive, otherwise will disappear (can be simulated by
systemctl stop haproxy) and the vip will appear in another configured node.
In the event that the master server (
haproxy1) fails, keepalived assigns the virtual IP address (e.g. 10.0.0.10/24) to the eth0 interface on the backup server (
haproxy2), which becomes the master server.
The active (master) router informs the backup routers of its active status using the Virtual Router Redundancy Protocol (VRRP), which requires the master router to send out advertisements at regular intervals. If the active router stops sending advertisements, a new master is elected.
Keepalived implements Virtual Router Redundancy Protocol, also known as VRRP. Usually, the VRRP protocol ensures that only one of the participating instances is running as MASTER. The other instances are in the BACKUP state listening for multicast packets from an instance with a higher priority.
If the BACKUP instance fails to receive VRRP advertisements for a period longer than the KEEPALIVED_ADVERT_INT, the BACKUP instance moves to the MASTER state and it takes the VIP for itself. In case there is more than one instance in BA
A VIP address migrates from one LVS router to the other during a failover, thus maintaining a presence at that IP address. A VIP is also known as a floating IP addresses.
keepalived can be containerized or non-containerized.
Configs can be found in
They are managed by
systemctl restart haproxy systemctl enable haproxy systemctl restart keepalived systemctl enable keepalived
Check keepalived config:
kubectl -n kube-system exec kube-keepalived-master -- cat /etc/keepalived/keepalived.conf