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 NodesMaximum Nodes that can go down
10
20
31
41
52

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-30-v5 version: v1.30.7 controlPlane: // [!code tooltip:5:1:Set the amount of replicas for the controlplane nodes here] replicas: 5 ...
Next
Introduction to Syself Autopilot