Designing Resilient Kubernetes Architecture
Designing a production Kubernetes architecture requires planning for node failures, control plane outages, and network partitioning.
1. High Availability (HA) Control Plane
Section titled “1. High Availability (HA) Control Plane”Never run a single master node in production. If that node fails, the cluster API is unreachable.
External Load Balancer (AWS NLB / HAProxy) │ (:6443) ┌──────────────────┼──────────────────┐ ▼ ▼ ▼ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Master Node1│ │ Master Node2│ │ Master Node3│ │ apiserver │ │ apiserver │ │ apiserver │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │ │ │ └───────────┬──────┴──────────────────┘ ▼ Raft Consensus Quorum (etcd) [ etcd 1 ] ── [ etcd 2 ] ── [ etcd 3 ]Key Architectural Guidelines
Section titled “Key Architectural Guidelines”- Odd Number of etcd Members: Always deploy 3 or 5 etcd nodes to maintain a Raft quorum ($Q = \lfloor N/2 \rfloor + 1$). A 3-node cluster survives 1 failure; a 5-node cluster survives 2 failures.
- Stateless API Servers: Multiple
kube-apiserverinstances run active-active behind an external load balancer. - Leader Election:
kube-schedulerandkube-controller-manageruse lease-based leader election to ensure only one instance actively makes decisions at a time.