โšก
Zero to Platform Architect2026
Phase 4: Kubernetes & Scaling
Phase 4: Kubernetes & Scalingโฑ๏ธ 3 min readโšก Staff SRE Standard
๐ŸŽฏ Operations Test Bank →

Phase 4: Kubernetes & Fleet Scaling

๐Ÿง  Beginner Mental Model (Explain Like Iโ€™m 5)

Think of Kubernetes (EKS) as an automated shipping port manager:

  • Control Plane (apiserver, etcd, scheduler): The port control tower that remembers where every container belongs and assigns ships to docks.
  • AWS VPC CNI & ALB Controller: Gives every pod a real VPC IP address so load balancers can route traffic directly to the container without extra hops.
  • Karpenter: An intelligent fleet buyer that watches waiting containers and rents the exact right-sized ARM64 Spot server from AWS in 40 secondsโ€”then returns the server the moment it empties.

๐Ÿงญ Step-by-Step Execution Playbook for Phase 4

  1. Step 1 (Control Plane, CNI & CSI): Master EKS internals, IRSA, EBS (RWO), and EFS (RWX) in Lesson 1.
  2. Step 2 (JIT Node Autoscaling): Deploy Karpenter and Spot interruption handlers in Lesson 2.
  3. Step 3 (Packaging & Ingress): Structure Helm + Kustomize overlays (Lesson 3) and Shared ALB Ingress Groups (Lesson 4).
  4. Step 4 (Observability & Upgrades): Configure Prometheus/PromQL (Lesson 5) and CoreDNS ndots tuning + zero-downtime EKS upgrades (Lesson 6).
  5. Step 5 (Azure AKS & Dependent PaaS Ecosystem): Master AKS Cilium CNI Overlay, Ephemeral NVMe OS Disks, Entra Workload Identity, Key Vault CSI, Cosmos DB, Service Bus, and KEDA in Lesson 7: Azure AKS & Dependent Services.

๐Ÿ“– Deep-Dive Index

1. Kubernetes Architecture & Identity

  • Control Plane vs Data Plane: API Server, etcd, Kubelet, Kube-Proxy.
  • Networking: VPC CNI (AWS IP assignment to Pods) vs Overlay Networks.
  • Authentication: IAM Roles for Service Accounts (IRSA). Tying a Kubernetes ServiceAccount to an AWS IAM Role via OIDC.

2. Auto-Scaling (Karpenter)

  • Cluster Autoscaler limitations: Slow scaling, static node groups.
  • Karpenter Mechanics: Provisioners / NodePools, NodeClaims, bypassing ASGs to talk directly to the EC2 fleet API.
  • Optimization: Workload consolidation, Spot instance orchestration, graceful termination handling via SQS interruption pipelines.

3. Stateful Storage Architecture

  • AWS EBS CSI Driver (RWO): NVMe block storage, single-AZ affinity, volumeBindingMode: WaitForFirstConsumer avoiding cross-AZ scheduling deadlocks, online dynamic volume expansion without pod downtime.
  • AWS EFS CSI Driver (RWX): Distributed Multi-AZ NFS v4.1 storage, shared multi-pod concurrent read/write, dynamic Access Point provisioning.

4. Cluster Networking & DNS Optimization

  • CoreDNS ndots:5 Query Amplification: Resolving the 5-second glibc conntrack drop race condition via NodeLocal DNSCache daemonsets (169.254.20.10).
  • Ingress & Gateway API: AWS ALB Ingress Grouping (group.name, target-type: ip) vs modern Gateway API (HTTPRoute developer canary routing).

๐Ÿ› ๏ธ Job-Essential Exercises

  1. Passwordless Workload Identity (IRSA):
    • Create an AWS S3 bucket. Create an IAM Role with read access. Associate this role with a K8s ServiceAccount. Deploy a Python pod using this ServiceAccount and verify it can list the S3 bucket without any AWS keys in the environment variables.
  2. Karpenter Spot Scaling:
    • Install Karpenter. Create a NodePool configured to use AWS Spot Instances (t3.medium, c5.large). Deploy a pod deployment with 0 replicas. Scale it to 30 replicas. Watch Karpenter instantly spin up precisely sized EC2 Spot instances.
  3. Cost Consolidation:
    • With the 30 replicas running across multiple nodes, scale the deployment back down to 2 replicas. Watch Karpenterโ€™s logs as it intelligently cordons, drains, and terminates the empty nodes to eliminate cloud waste.