Q&A-20Define rollout preflight checks.
Answer
What a strong candidate says first
A rollout preflight check is an automated gate that runs after the candidate is deployed but before any production traffic reaches it. It answers two questions: is this rollout safe to start, and will the old-vs-new comparison be valid? If either answer is no, the rollout does not start.
Assume a canary rollout of a stateless HTTP service: baseline (last-known-good) and candidate both behind a load balancer, SLO of 1% error rate and p99 < 300 ms. The checks fall into three groups (artifact integrity, environment readiness, observability and rollback readiness) and they run in that order because each is cheaper to fail than the next.
| Check | Probe | Pass condition | What it prevents |
|---|---|---|---|
| Artifact integrity | cosign verify --key cosign.pub ghcr.io/acme/myapp@sha256:<digest> | signature verifies against the digest being deployed | Tampered or wrong image reaching production |
| Baseline health | PromQL error ratio over the last 5 min for version="baseline" | ≤ 0.2% | Pre-existing errors attributed to the candidate |
| Candidate readiness | kubectl get pods -l app=myapp,version=candidate | every pod Ready | Traffic to unready pods → 503s |
| Capacity | free allocatable CPU/memory on nodes after current pods | ≥ candidate's total requests | Canary starves baseline, latency spikes on both |
| Rollback path | kubectl rollout undo deployment/myapp --dry-run=server | API accepts, RBAC allows | Finding out mid-incident that you can't revert |
The dry-run proves the API call and RBAC, not that the revert restores service: that is what a game-day rehearsal is for.
Why preflight, not just watch the canary
A canary comparison is only valid if the baseline is healthy and the metrics are trustworthy. If the baseline is already at 0.5% errors, a candidate at 0.6% looks fine and a candidate at 1.4% looks like a regression when it may not be. Preflight pins the baseline before the comparison starts. Same for metrics: if the candidate's pods don't carry the version label, the canary query returns nothing and you read silence as health.
Worked capacity check
Baseline runs 4 replicas at 500m CPU = 2000m. A full canary doubles that, so the cluster needs 2000m of allocatable CPU free after the baseline is scheduled. Say 3 nodes × 4 vCPU = 12 vCPU allocatable, other workloads hold 8 vCPU, baseline holds 2. Free = 2 vCPU: exactly enough for a full canary and no margin. Either add a node or cap the canary at 50% (2 replicas, 1000m). The check is arithmetic, not a vibe.
Failure modes and detection
- Baseline health skipped: pre-existing errors get attributed to the candidate and you roll back a good release. Detection: the preflight itself fails and pages on-call with the failing check and the PromQL result.
- Capacity skipped: canary and baseline compete for CPU, p99 climbs on both, and you can't tell whether the candidate is slow or the node is saturated. Detection:
container_cpu_cfs_throttled_seconds_totalrising on baseline pods. - Rollback rehearsal skipped: you discover during the incident that the previous image was garbage-collected or the migration isn't backward compatible. Detection: only at the worst possible time, which is the point.
When to run a reduced set
Preflight costs 2-5 minutes per rollout plus maintenance. The deciding criterion is blast radius × time-to-revert. A config-only change with no new image, no migration, and a rollback that is a single flag flip: keep baseline health and rollback, skip capacity and migration. A change that can hit all users and takes more than 10 minutes to revert: run everything.
If a check fails
The rollout is blocked before any traffic moves. On-call gets the failing check and its evidence: e.g. baseline error rate 0.5% against a 0.2% threshold, and investigates the baseline first. The goal isn't zero risk; it's a valid comparison and a way out.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.