# Senior Kubernetes playbook

Compressed reference for the senior-only Kubernetes extension. Pair with [cheat-sheet.md](./cheat-sheet.md), [GLOSSARY.md](./GLOSSARY.md), and [repo-kubernetes-map.md](./repo-kubernetes-map.md).

## The senior shift
Intermediate understanding is: "I know the Kubernetes objects, the control loop, Services, StatefulSets, probes, autoscaling, scheduling, PDBs, namespaces, RBAC, and ServiceAccounts."

Senior understanding is: "I can explain what Kubernetes truly guarantees, where rollout and disruption safety can still fail, when StatefulSet use is justified, how scaling signals should match workload shape, and how to review Kubernetes designs honestly."

## Six senior lenses
1. **Truthfulness beats folklore** — explain what the control loop really maintains, not what people vaguely hope Kubernetes guarantees.
2. **Rollout safety is interactional** — probes, PDBs, and termination behavior must form one believable safety story.
3. **StatefulSet is for contracts, not prestige** — stable identity, ordering, and per-pod state are the real reasons to use it.
4. **Scaling follows workload semantics** — queue lag, request rate, and activation behavior often matter more than CPU alone.
5. **Identity and permissions are layered** — separate ServiceAccount identity, Workload Identity, and actual RBAC permissions.
6. **Review is about guarantees and operability** — ask what the design truly enforces, how understandable it is, and how it fails under pressure.

## Senior review checklist
- What exactly does the controller guarantee here, and what does it not?
- Are readiness, liveness, startup, PDB, and termination settings aligned into a believable rollout story?
- Would this workload truly break under a Deployment, or is StatefulSet being overused?
- Does the autoscaling signal match the real backlog or pressure shape?
- Are spot-node, affinity, and scheduling choices explained honestly in terms of risk?
- Is cloud/API access grounded in a clear ServiceAccount + Workload Identity story without overclaiming RBAC scope?
- Could a new engineer operate this workload correctly from the generated-object and template story alone?

## Interview answer shapes
### What does Kubernetes really guarantee?
It guarantees ongoing reconciliation toward desired object state, not automatic correctness of probes, rollout safety, or workload semantics.

### What makes a rollout safe?
Believable interaction between rollout mechanics, readiness/liveness/startup behavior, disruption bounds, and shutdown/drain semantics.

### When is StatefulSet justified?
When stable identity, ordered lifecycle, or per-pod state would genuinely break if the workload became a Deployment.

### How would you summarize the repo’s scaling model?
KEDA-heavy and workload-shaped: event/backlog signals matter more than CPU-only defaults for key paths like Kafka consumers.

### What is the real job of a senior Kubernetes reviewer?
To ask what the design truly guarantees, where the story is partial or misleading, how recoverable failures are, and whether operators can understand the trade-offs under pressure.
