Stage 1, Part 4 of 9 · p. 4, Kubernetes Fundamentals (Day 0/1)

PART 4: CAPACITY PLANNING & COST MODELING

18. Cluster Sizing Fundamentals

Node Sizing

Workload TypeNode SizeWhy
General apps4–8 vCPU, 16–32 GBBalanced
Databases8–16 vCPU, 64–128 GBMemory + I/O
ML trainingGPU nodesSpecialized hardware
BatchHigh CPUCompute-optimized

Cluster Sizing Formula

text
Total CPU needed = sum(pod requests) × overcommit_ratio + system_overhead
Total memory needed = sum(pod requests) × overcommit_ratio + system_overhead

overcommit_ratio for CPU: 2-4x
overcommit_ratio for memory: 1-1.5x (be conservative)

Reserved Capacity

Reserve ~10–20% for:

19. Resource Overcommit and Cost Optimization

Overcommit Ratios

ResourceSafe OvercommitRisk
CPU2–4xThrottling
Memory1–1.5xOOMKill
Disk1xCapacity exhaustion

Cost Optimization Tactics

TacticSavings
Right-size requests/limits20–40%
Use Spot/Preemptible nodes60–80% for interruptible
Bin-packing20–30%
AutoscalingVariable
Reserved instances30–60%
Multi-tenancy30–50%

Example: 100-Node Cluster

text
Before optimization:
  100 × m5.2xlarge ($0.384/hour) = $27,648/month
  Average utilization: 25%

After optimization:
  Right-size: 60 nodes
  Spot for batch: 20 nodes at 70% discount
  Reserved for baseline: 30 nodes at 40% discount

Costs:
  Baseline: 30 × $0.384 × 730 = $8,409
  Spot: 20 × $0.115 × 730 = $1,679
  Total: $10,088/month

Savings: $17,560/month = $210,720/year

20. SLA & Availability Design

Availability Math

text
99.9%   = 8.76 hours downtime/year
99.99%  = 52.56 minutes downtime/year
99.999% = 5.26 minutes downtime/year

Kubernetes SLA Design

TargetArchitecture
99.9%Multi-replica Deployments, basic monitoring
99.99%Multi-AZ, PodDisruptionBudgets, anti-affinity, HA control plane
99.999%Multi-region, chaos-tested, GitOps, automated recovery

Zero-Downtime Checklist


1:1 copy of the class Google Doc, code in code blocks.