Amazon EKS — Project 4 — High Availability Cluster
Project 4 — High Availability EKS Cluster
Build a production-grade cluster that survives AZ failures, node crashes, and traffic spikes.
HA Architecture
Multi-AZ HA Cluster
┌──────────────────────────────────────────────────────┐
│ Region: us-east-1 │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ AZ-1a │ │ AZ-1b │ │ AZ-1c │ │
│ │ │ │ │ │ │ │
│ │ ┌─────────┐ │ │ ┌─────────┐ │ │ ┌─────────┐ │ │
│ │ │ Node 1 │ │ │ │ Node 3 │ │ │ │ Node 5 │ │ │
│ │ │ Node 2 │ │ │ │ Node 4 │ │ │ │ Node 6 │ │ │
│ │ └─────────┘ │ │ └─────────┘ │ │ └─────────┘ │ │
│ │ │ │ │ │ │ │
│ │ ┌─────────┐ │ │ ┌─────────┐ │ │ ┌─────────┐ │ │
│ │ │ EBS Vol │ │ │ │ EBS Vol │ │ │ │ EBS Vol │ │ │
│ │ └─────────┘ │ │ └─────────┘ │ │ └─────────┘ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ EFS (shared storage — all AZs) │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ RDS Multi-AZ (automatic failover) │ │
│ └──────────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────────────────────┘
Step 1: Cluster with Multi-AZ
# cluster-ha.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: ha-cluster
region: us-east-1
version: "1.29"
availabilityZones:
- us-east-1a
- us-east-1b
- us-east-1c
managedNodeGroups:
- name: critical
instanceType: m5.xlarge
desiredCapacity: 6
minSize: 3
maxSize: 12
availabilityZones:
- us-east-1a
- us-east-1b
- us-east-1c
Step 2: Pod Anti-Affinity (Spread Across AZs)
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values: ["web"]
topologyKey: topology.kubernetes.io/zone
Step 3: PodDisruptionBudgets
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: web-pdb
spec:
minAvailable: "50%"
selector:
matchLabels:
app: web
Step 4: Health Checks
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
What You Practiced
- Multi-AZ node distribution
- Pod anti-affinity for zone spreading
- PodDisruptionBudgets for safe maintenance
- Health checks for automatic recovery
- Auto-scaling for demand handling
What’s Next?
Save money: Project 5 — Cost Optimization.