Theory
Theory: HPA Owns Replicas; Canary Steps Also Own Replicas
Two controllers cannot both own spec.replicas without a rule. setCanaryScale and traffic-based splits exist to stop HPA from shrinking the canary out of existence.
Invariants
- Replica-based canary + HPA on the Rollout is the subtle bug.
- Traffic-based canary lets HPA scale the whole set more safely.
- Metrics-server must exist for HPA to do anything.
HPA --replicas--> Rollout <-- canary step replica math
What can break
- HPA on both stable and canary Deployments independently.
How to read this chapter
The problem, metrics, setCanaryScale.