KubernetesCXXX · Production Anti-PatternsProduction anti-patterns
Top 20 production anti-patterns — the cluster's hidden failures
What you'll learn
- Identify the top 20 production anti-patterns
- Diagnose the anti-pattern's impact
- Distinguish the high-impact from the low-impact anti-patterns
- Apply the discipline of anti-pattern detection
Prerequisites
Verified against Kubernetes 1.34.x · kubeadm 1.34.x · kubectl 1.34.x · etcd 3.6.x · CoreDNS 1.11.x · containerd 1.7.x / 2.x · 2026-08-16
The top 20 production anti-patterns are the cluster’s hidden failures. The diagnostic is the anti-patterns, the impact, and the systematic approach to identifying and fixing them. The discipline is the same scale-free: every anti-pattern gets a fix.
The top 20 anti-patterns
The top 20 production anti-patterns are:
- :latest tags. The image is
:latest; the cluster is at the mercy of the registry. - No requests. The container declares no CPU or memory requests. The Pod still schedules — that is the problem. The scheduler accounts it as needing nothing, so it fits anywhere, and the node ends up oversubscribed until the kubelet starts evicting under pressure.
- No limits. The container has no CPU/memory limits; the workload can starve the node.
- No probes. The container has no readiness/liveness probes; the kubelet cannot detect failures.
- No PDB. The workload has no PodDisruptionBudget; the workload can be evicted.
- Privileged containers. The container is privileged; the workload has root access.
- Default ServiceAccount. The workload uses the default ServiceAccount; the workload has unnecessary privileges.
- Secrets in manifests. The Secret is in the manifest; the credential is in the git repo.
- No NetworkPolicies. The workload has no NetworkPolicy; the workload is reachable from any Pod.
- No backup. The workload has no backup; the data is not recoverable.
- No etcd test. The etcd snapshot is not tested; the restoration is not rehearsed.
- Manual edits. The cluster is managed by manual edits; the cluster’s state is not reproducible.
- No monitoring. The cluster has no monitoring; the failures are not detected.
- All replicas on one node. The workload’s replicas are on one node; the node failure takes the workload down.
- No anti-affinity. The workload has no podAntiAffinity; the replicas are on the same node.
- No topology spread. The workload has no topology spread; the replicas are in the same zone.
- No resource quota. The namespace has no ResourceQuota; the namespace can starve the cluster.
- No LimitRange. The namespace has no LimitRange; the namespaces can have unbounded workloads.
- No Pod Security Standards. The Pod has no
pod-security.kubernetes.io/enforcelabel; the privileged containers are allowed. - No RBAC. The user has cluster-admin; the user has unlimited privileges.
flowchart TD
A[Production anti-patterns] --> B[Image]
A --> C[Resources]
A --> D[Probes]
A --> E[Availability]
A --> F[Security]
A --> G[Backup]
A --> H[Operations]
A --> I[Multi-tenancy]
A --> J[Compliance]
The anti-patterns are the cluster’s hidden failures.
The diagnostic
The canonical diagnostic:
# Substitute the path to the manifest you want scanned:
MANIFEST=deploy/checkout-api.yaml
# Use Polaris to detect anti-patterns
polaris audit --format yaml
# Use Datree to detect anti-patterns
datree test "$MANIFEST"
# Use kube-score to detect anti-patterns
kube-score score "$MANIFEST"
The diagnostic is the anti-pattern detection.
The high-impact anti-patterns
The high-impact anti-patterns are the ones that cause the most production failures:
- :latest tags. The cluster upgrades silently.
- No requests. The scheduler treats the Pod as free and overcommits the node.
- No limits. The workload starves the node.
- No probes. The kubelet cannot detect failures.
- No PDB. The workload is evicted.
- Privileged containers. The workload has root access.
- Default ServiceAccount. The workload has unnecessary privileges.
- No backup. The data is not recoverable.
- No etcd test. The restoration is not rehearsed.
- All replicas on one node. The workload is on a single point of failure.
The high-impact anti-patterns are the production’s most dangerous.
The remediation
The remediation depends on the anti-pattern:
# Option 1: Use a Polaris pipeline
# (CI pipeline that detects anti-patterns)
# Option 2: Use a Datree policy
# (GitOps policy that detects anti-patterns)
# Option 3: Use a kube-score pipeline
# (CI pipeline that scores the manifests)
The remediation is the anti-pattern fix.
Production discipline
Anti-patterns are the cluster’s hypothesis. The discipline is to walk the 11-step methodology applied to the anti-patterns, identify the cause, apply the remediation. The cluster’s discipline is the same scale-free: every anti-pattern gets a fix.
- Scan the manifests, then verify the behaviour. Polaris, kube-score, and Datree score the spec you submitted; a PDB whose selector matches no Pods and three replicas on one node both score as a pass.
- Prioritise by blast radius.
:latesttags, missing requests and limits, missing probes, missing PDBs, and privileged containers are the anti-patterns that cause the most production failures. - Run the detection in CI. A scan that runs only when someone remembers is not prevention; the pipeline is where the anti-pattern is caught before it reaches the cluster.
Quiz
Knowledge check · 4 questions
Q1. Which of the following is the most dangerous production anti-pattern?
Q2. A container that sets resources.limits but no resources.requests is scheduled as though it had requested the whole limit.
Q3. A single node reboot took a service down for 25 minutes. Name the anti-patterns that turned one node loss into an outage and remove them.
checkout runs 6 replicas in namespace prod. node-04 rebooted for a kernel update at 02:10 and checkout was unavailable until 02:35. kubectl get pods -o wide taken before the reboot shows all 6 replicas on node-04. The Deployment has no PodDisruptionBudget, its image is registry.example.com/checkout:latest, and its container declares no readiness probe.
Q4. Name three tools for detecting anti-patterns and explain what each one does.
Passing score: 75%. Answers are checked in this browser.