✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Kubernetes High Availability Architecture

Kubernetes High Availability Architecture ensures resilient operations with distributed control planes, redundant nodes, and automated failover.

Kubernetes High Availability Architecture is the composite arrangement of redundancy at every layer of a cluster, control plane, etcd, worker nodes, and the workloads running on them, mapped deliberately against the physical or logical failure domains a cluster spans, such that the loss of any single component, machine, or even an entire availability zone does not interrupt the cluster's ability to serve traffic or continue reconciling. High availability is not a single setting; it is the alignment of redundancy at each layer with the actual failure domains present in the underlying infrastructure.


Failure Domains as the Organizing Concept

What a Failure Domain Represents

A failure domain is formally a boundary within which a single failure event, a machine crash, a rack losing power, a zone-wide network outage, can plausibly affect every resource inside it simultaneously; high availability architecture is fundamentally the practice of ensuring no single failure domain contains every replica of anything critical.

HA critical component : replicas span ≥ 2 failure domains

Common Failure Domain Hierarchy

Failure domains in a typical cloud deployment nest hierarchically: individual machines, within racks or hosts, within availability zones, within regions, with each level representing a progressively larger, progressively rarer category of simultaneous failure.


Control Plane Redundancy

Multiple API Server Replicas

The API server's statelessness with respect to its own replicas formally allows any number of them to run simultaneously behind a load balancer, distributed across separate failure domains, so that losing any individual replica, or an entire zone hosting a subset of them, leaves the remaining replicas able to continue serving the full API surface.

control_plane_nodes:
  - { host: cp-1, zone: us-east-1a }
  - { host: cp-2, zone: us-east-1b }
  - { host: cp-3, zone: us-east-1c }

etcd Quorum Across Failure Domains

etcd's Raft-based redundancy is only meaningful if its members are distributed across separate failure domains; three etcd members all in the same zone formally provide fault tolerance against individual machine failure but not against a zone-wide outage, whereas one member per zone across three zones tolerates the loss of an entire zone.

tolerable failure = max { d failure domains losing d preserves quorum }

Leader-Elected Components

Because kube-scheduler and kube-controller-manager use leader election rather than concurrent active replicas, their high availability comes not from load distribution but from rapid failover: a standby replica in a different failure domain from the current leader takes over automatically if the leader becomes unreachable.


Node-Level Redundancy

Worker Nodes Across Zones

Distributing worker nodes across multiple availability zones, and using topology spread constraints or anti-affinity rules to actually place workload replicas across those zones rather than concentrating them, is what translates node-level infrastructure redundancy into actual workload availability.

spec:
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: topology.kubernetes.io/zone
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app: codartium-api

Cluster Autoscaler Awareness of Zones

A properly configured Cluster Autoscaler formally provisions replacement node capacity within the same zone as the node it is replacing when possible, preserving the zone distribution a workload's topology constraints depend on, rather than concentrating replacement capacity in a single zone.


Workload-Level Redundancy

Replica Count and Disruption Budgets

Even with fully redundant infrastructure beneath it, a workload configured with a single replica remains a single point of failure; sufficient replica counts combined with PodDisruptionBudgets formally translate underlying infrastructure redundancy into actual application-level availability during both failures and planned maintenance.

infrastructure HA replicas = 1 application HA

Multi-Cluster High Availability

Beyond a Single Cluster's Failure Domain

Because a single cluster's control plane, regardless of how redundantly deployed, still represents one overall failure domain (a cluster-wide misconfiguration, a botched upgrade, an API server bug), the strongest availability architectures extend redundancy beyond a single cluster, running multiple independent clusters, often in different regions, with traffic distributed or failed over between them by a layer above Kubernetes itself.

kubectl config get-contexts
kubectl --context=codartium-region-a get nodes
kubectl --context=codartium-region-b get nodes

Verifying High Availability Architecture

Testing Failure Domain Assumptions

An HA architecture's actual guarantees are only as strong as they have been verified to be; deliberately draining a control plane node, terminating an etcd member, or cordoning an entire zone's worth of nodes in a controlled test formally validates that the redundancy assumed on paper actually holds when a failure domain is genuinely lost.

kubectl drain cp-2 --ignore-daemonsets
kubectl get nodes -o wide

Why HA Is Architected as Alignment, Not a Single Setting

High availability emerges from consistently mapping redundancy, control plane replicas, etcd members, worker nodes, workload replicas, against the actual failure domains present in the underlying infrastructure at every layer simultaneously; redundancy at only one layer, a highly available control plane running workloads with a single replica each, or vice versa, leaves the overall system only as available as its weakest, non-redundant layer.