Stage 10, Part 4 of 9 · p. 86, Autoscaling & Cost Optimization

PART 4: CAPACITY PLANNING & COST MODELING

17. Cost Modeling and FinOps

The FinOps Lifecycle

PhaseActivities
InformCost visibility, allocation, showback
OptimizeRightsizing, spot, bin-packing
OperateGovernance, budgets, alerts

Cost Allocation Dimensions

DimensionExample
Namespaceteam-a, team-b
Labelapp=web, env=prod
Deploymentweb, api, db
Clusterprod-us-east, prod-eu-west

The Optimization Formula

text
Savings = (Current cost) - (Optimized cost)

Optimized cost = (Rightsized resources × Correct price) × (1 - Spot discount)

Example:
  Current: 100 nodes × $0.20/hour = $20/hour
  Rightsized: 60 nodes
  Spot: 40% of nodes at 70% discount
  Optimized: (60 × $0.20 × 0.6) + (60 × $0.20 × 0.4 × 0.3) = $8.64/hour
  Savings: 57%

18. Optimization ROI Calculation

The ROI of Autoscaling

OptimizationTypical SavingsEffort
Rightsizing (VPA)20–40%Low
Spot instances60–90% on eligible workloadsMedium
Bin-packing20–30%Medium
Karpenter consolidation30–50%Medium
KEDA scale-to-zero50–80% on batchMedium
Combined50–70%High

Case Study: Cast AI Evictor

“Cast AI Evictor cut node count by 50% in one measured case, keeping remaining nodes at 80% CPU utilization.”


19. SLA & Availability Design for Autoscaling

Availability Math

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

Autoscaling SLA Design

TargetArchitecture
99.9%HPA with 2+ replicas, basic monitoring
99.99%HPA + VPA (Off) + PDBs + Karpenter
99.999%Full stack: HPA + KEDA + Karpenter + Spot with fallback + chaos-tested

The Availability vs Cost Trade-Off

StrategyAvailabilityCost
On-demand onlyHighestHighest
Mixed spot + on-demandHighMedium
Spot onlyMediumLowest
Bin-packedLower (blast radius)Lowest

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