HA Kubernetes Controlplane

Introduction

We strongly recommend that you deploy your control plane in a highly available configuration. Providing redundancy and fault tolerance minimizes downtime in the event of node failures or sudden workload spikes.

For production clusters, the recommended amount of controlplane nodes is 5, but if you have a small cluster, you might be good with only 3. You shouldn't use just 1 controlplane for anything more than a disposable test cluster.

With only two nodes, if one node fails or becomes unreachable, the cluster loses quorum, which can lead to a split-brain scenario where each node believes it's the leader. Below you can find a table showing the number of controlplanes your cluster can tolerate the failure of.

Amount of Control Plane Nodes Maximum Nodes that can go down
1 0
2 0
3 1
4 1
5 2

Because of this, you should always aim to use an odd amount of controlplane nodes to properly achieve an increase in availability.

Making Your Cluster Highly Available

You can edit your Cluster resource in the management cluster, or the cluster.yaml file in your GitOps repository, and change the spec.topology.controlplane.replicas to set the amount of controlplane nodes you want. In the example below, we set it to 5.

cluster.yaml yaml
apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: mycluster spec: clusterNetwork: services: cidrBlocks: ['10.128.0.0/12'] pods: cidrBlocks: ['192.168.0.0/16'] serviceDomain: 'cluster.local' topology: class: hetzner-apalla-1-29-v4 version: v1.29.6 controlPlane: // [!code tooltip:5:1:Set the amount of replicas for the controlplane nodes here] replicas: 5 ...
Previous
Using specific Cluster Stack versions
Next
etcd encryption