High Availability in Kubernetes

Gaurav Kaushik
2 min readApr 16, 2021

--

API Interaction in case of High Availability in Kubernetes Cluster

Kubernetes is already designed to deploy Pods(containers) as Highly Available. But what if the user wants the kubernetes cluster itself as HIGHLY AVAILABLE.
To accomplish this we need to have multiple Control Plane nodes in the k8s cluster. Although, with multiple Control Plane nodes, comes multiple instances of ‘kube-api-cluster’ &with this arrangement there is a need of ‘Load Balancer’ to have communication with worker nodes using k8s apis.

Therefore, In order to have communication with one of the control plane nodes or kube-api-server instances, the kubectl has to go through a Load Balancer, as shown in the figure above.

When talking about High availability for the k8s cluster, managing ‘etcd’ becomes an important factor. The Design Pattern consideration becomes more crucial when the setup consists of several worker nodes.
Two of such Design Patterns are:
1) Stacked etcd
2) External etcd

With Stacked etcd, the etcd runs on the same node as the rest of the control plane components. This means that every control plane node will be having its own etcd instance. This pattern is used in small setups & is used by kubeadm to create a kubernetes cluster.

A Kubernetes cluster with Stacked etcd

In the case of External etcd, the etcd runs on completely separate nodes. We can have multiple etcd nodes in HA cluster & that set of servers will be a different set of servers than the ones that are running other normal k8s control plane components. With this model you can have any number of control plane instances and any number of etcd nodes.

A Kubernetes cluster with External etcd

This was a brief overview of how HA will work for a Kubernetes Cluster. In the next post we will understand the concept of Draining of a Kubernetes node and how to upgrade a Kubernetes node.

--

--

Gaurav Kaushik
Gaurav Kaushik

No responses yet