Defect Scenarios Best Practices
Every incident in this section shares a shape: a plausible setting meets a trigger and becomes an outage.
Search across all documentation pages
Every incident in this section shares a shape: a plausible setting meets a trigger and becomes an outage.
The highest-leverage response is to convert each lesson into a machine-enforced rule so the same defect cannot reach the cluster again.
Treat each practice as a candidate admission policy, a CI check, or a default in your base manifests.
Adopt the group that matches your current pain first, then work toward enforcing all of them.
Enforcement beats documentation: a rule in a mutating or validating policy stops the defect at apply time, while a wiki page does not.
:latest tag in production. Enforce with a Kyverno or Validating Admission Policy rule so a mutable tag cannot be applied.image@sha256:... so the running bytes are cryptographically fixed and rollback is exact.imagePullPolicy explicitly. Avoid the implicit Always that :latest triggers, which maximizes drift across nodes.requests and limits. Requests drive scheduling and QoS; limits are the kernel-enforced ceiling that prevents a noisy neighbor.-XX:MaxRAMPercentage for the JVM and --max-old-space-size for Node so the heap fits under the limit.kubectl top to set requests and limits from observed peak usage.startupProbe for slow boot. It suspends liveness during startup so a cold start under load is not mistaken for a deadlock.timeoutSeconds above measured peak latency so a busy-but-healthy pod is not killed./livez and /readyz endpoints. Distinct handlers keep restart logic and traffic logic from coupling.NetworkPolicy. Deny ingress by default per namespace and allow only the flows each service needs.ResourceQuota and LimitRange. Bound what one namespace can consume and supply default limits so unset pods still get a ceiling.maxUnavailable, a PodDisruptionBudget, and canary or progressive delivery to slow amplification.namespaceSelector and prefer failurePolicy: Ignore for non-security webhooks so one webhook cannot wedge the cluster.restartCount or Reason: OOMKilled is signal that green request dashboards will miss.imageID per Deployment to catch silent version drift.You should be able to point at a policy, check, or default for every scenario in this section.
If a defect can still be applied to the cluster by hand, it is documentation, not enforcement, and it will happen again.
Aim for a state where the plausible mistakes in this section fail loudly at apply time or in CI, long before a trigger can reach production.
Where should I start if I can only do one thing? Ban :latest and require memory limits at admission - those two rules eliminate the two most common silent defects.
Policy engine or Validating Admission Policy? Validating Admission Policy (CEL, in-tree) covers many checks with no extra controller. Kyverno or Gatekeeper add mutation and richer libraries when you need them.
Will strict policies block legitimate deploys? Roll out in audit or warn mode first, fix violations, then switch to enforce so teams migrate without surprise outages.
Do these rules replace load testing? No. Policies stop known-bad patterns, but only load and chaos testing reveal the trigger thresholds behind sizing and probe settings.
How do I keep rules from drifting? Store policies in Git, deploy them via GitOps, and test them in CI so the guardrails are themselves versioned and reviewed.
Stack versions: This page was written for Kubernetes 1.36.2, Docker Engine 29.6.1 (BuildKit default), containerd (CRI runtime on nodes), Helm 3, Compose v2, Argo CD (latest - verify at build), and Gateway API (GA - verify controller support at build).
Reviewed by Chris St. John·Last updated Jul 16, 2026