Objective

To understand how Kubernetes HA is implemented, especially the stacked etcd topology.

Kubernetes Control Plane HA Architecture

Kubernetes Control Plane HA Architecture

Concepts

In addition to three control plane nodes, HAProxy and Keepalived are the key components to implement Highly Available Kubernetes Control Plane.

HAProxy

Like Nginx, HAProxy is a popular open source TCP/HTTP Loadbalancer and Proxy solution. HAProxy balance the traffic among Kubernetes Control Plane nodes via Control Plane VIP. However, if a single HAProxy instance is deployed, Kubernetes Control Plane will become unavailable once the HAProxy failed. Multiple HAProxy instances are used to avoid the single point of failurei problem.

Keepalived

When one HAProxy instance failed, the Control Plane VIP needs to float to the HAProxy instance that is up. This is when Keepalived comes to rescue. Keepalived is actively monitoring the liveness of HAProxy at local node and chatting with its peers. Instead of using Keepalived, Kubernetes Under the Hooduese the comibnation of Corosync and Pacemaker as an alternative.

Reference