Loading...


Updated 15 Jul 2026 • 10 mins read

Kubernetes best practices cluster into five domains: workload configuration (requests, limits, probes), reliability (replicas, autoscaling, disruption budgets), security (RBAC, network policies, image hygiene), operations (namespaces, GitOps, upgrades, observability), and cost, where research puts average cluster waste near 47 percent. Fifteen rules, each with the why.
Kubernetes is honest infrastructure: it does exactly what your manifests say, which is the problem, because the defaults say very little. No requests means chaotic scheduling, no probes means traffic to dead pods, no policies means a flat network, and no ownership labels means a bill nobody can explain. The clusters that feel magical are not running different software; they are running the same software with discipline applied at fifteen specific points.
This guide covers those points across five domains, workload configuration, reliability, security, operations, and cost, with the reasoning behind each, so the practices survive contact with your team's edge cases. If the primitives themselves are new, start with our Kubernetes explainer and the pod-node-cluster hierarchy; this article assumes the vocabulary.
Key takeaway Fifteen rules carry most of the value. Workloads: set requests from measured usage, set memory limits deliberately, and give every pod real probes. Reliability: run multiple replicas spread across nodes, autoscale pods and cluster together, define disruption budgets, and handle shutdown gracefully. Security: least-privilege RBAC, default-deny network policies, externalized secrets, and scanned, minimal, non-root images. Operations: namespaces and labels as standards, GitOps for everything, a real upgrade cadence, and observability from day one. Cost: treat requests-versus-usage as a tracked metric, because studies put average cluster resource waste near 47 percent, and almost all of it hides behind healthy-looking dashboards.
Requests are promises to the scheduler, and unset or copy-pasted requests produce either chaos (unschedulable spikes, noisy neighbors) or waste (nodes reserved for capacity nobody uses). Set them from observed usage with sensible headroom, revisit them as workloads evolve, and treat the requests-to-usage ratio as a health metric, it is also the cost metric, as domain five explains.
Memory limits protect nodes from runaway pods, exceeding them means an OOMKill, so set them with room above real peaks. CPU limits are more debatable, throttling can hurt latency-sensitive services, so decide per workload class rather than by blanket policy, and document the decision so the next engineer inherits reasoning, not cargo cult.
Readiness probes keep traffic away from pods that cannot serve; liveness probes restart the truly wedged; startup probes protect slow-booting apps from liveness misfires. A pod without probes is a pod Kubernetes cannot manage, and the platform's self-healing reputation is really just probes configured well.
Multiple replicas of anything that matters, spread across nodes and zones with anti-affinity or topology spread constraints, so one machine's death is an event only the dashboard notices.
Horizontal pod autoscaling matches replicas to load; cluster autoscaling matches nodes to replicas; both must genuinely contract after peaks, or every spike becomes a permanent floor. Load-test the scale-in path, it is the half nobody rehearses.
Upgrades and node drains are routine; PDBs make them safe by bounding how many replicas can be down simultaneously, turning cluster maintenance from a risk event into a background process.
Handle termination signals, drain in-flight work within the grace period, and set preStop hooks where needed: pods are cattle, and cattle-handling is what makes spot nodes, autoscaling, and rolling deploys boring instead of lossy.
Scope roles to namespaces and verbs actually needed, avoid cluster-admin outside break-glass, and review bindings on a cadence, in Kubernetes, identity is the perimeter, same as the broader cloud security model.
A policy-less cluster is a flat network where any pod reaches any pod; default-deny with explicit allows contains blast radius and makes east-west traffic an architecture decision instead of an accident.
Secrets belong in a manager (or at minimum encrypted at rest with tight RBAC), never in manifests or images; images should be minimal, scanned in the pipeline, pinned by digest, and run as non-root with a restrictive security context. The pipeline side of this lives in our CI/CD best practices.
Namespaces per team or environment with quotas attached, and a mandatory label taxonomy, team, service, environment, enforced at admission: labels are how everything downstream, monitoring, policy, and cost allocation, knows what anything is.
All manifests in version control, applied by pipeline or a GitOps controller, with drift detection: reviewable changes, reproducible clusters, and rollbacks that are just reverts, Kubernetes as infrastructure as code taken seriously.
Kubernetes versions age out fast; falling multiple minor versions behind converts a routine upgrade into a migration project. Track the support window, upgrade non-production first, and let PDBs and probes (rules three and six) make the rollout boring.
Metrics, logs, and events wired before the first incident, not after: the cluster-specific signals and stack choices are their own topic, covered in our Kubernetes monitoring guide, and the practices above all assume you can see what they are doing.
Kubernetes bills through nodes while running through pods, so over-requested workloads force over-provisioned clusters that look perfectly healthy, StormForge's research put average cluster resource waste near 47 percent, and none of it appears on any default dashboard. The practice: workload-level requests-versus-usage visibility, rightsizing on a monthly cadence, cluster autoscaler bin-packing reviewed, spot node pools under interruptible work, and the label taxonomy from rule eleven feeding cost allocation so every namespace has an owner, the full program in our Kubernetes cost optimization guide.
| Domain | Rules | The failure they prevent |
|---|---|---|
| Workloads | Measured requests; deliberate limits; probes everywhere | Chaotic scheduling, OOM storms, traffic to dead pods |
| Reliability | Replicas + spread; two-layer autoscaling; PDBs; graceful shutdown | Single-node outages, ratcheting capacity, risky maintenance |
| Security | Least-privilege RBAC; default-deny networking; secrets and image hygiene | Flat networks, credential sprawl, vulnerable images |
| Operations | Namespace and label standards; GitOps; upgrade cadence; observability | Snowflake clusters, drift, forced migrations |
| Cost | Requests-vs-usage tracked; rightsizing cadence; spot pools; allocation labels | The ~47% waste hiding behind green dashboards |
Adopting the fifteen without a mutiny Enforce at admission, not in review comments: policies that block unlabeled or limit-less workloads at deploy time make the practices ambient instead of adversarial. Roll out in the order failure hurts, probes and PDBs before an upgrade, requests before a cost push, and pair every mandate with a paved-road template so compliance is the easy path. Discipline that ships as good defaults gets adopted; discipline that ships as audits gets routed around.
Kubernetes best practices are fifteen answers to one question: what did the defaults leave unsaid? Requests and probes tell the scheduler and the platform the truth about your workloads; replicas, autoscaling, and disruption budgets make failure and maintenance boring; RBAC, network policies, and image hygiene shrink the blast radius; namespaces, GitOps, upgrades, and observability keep the fleet governable; and requests-versus-usage discipline recovers the near-half of cluster spend that hides behind healthy dashboards. That last domain is where OpsLyft plugs in natively: workload-level cost visibility, request rightsizing recommendations, and label-driven allocation across every cluster you run, so the best-practice cluster is also, finally, the affordable one.
Fifteen across five domains: measured requests, deliberate limits, and probes (workloads); replicas with spread, two-layer autoscaling, disruption budgets, graceful shutdown (reliability); least-privilege RBAC, default-deny network policies, secrets and image hygiene (security); namespace and label standards, GitOps, upgrade cadence, observability (operations); and requests-versus-usage cost discipline.
Requests, yes, from measured usage, they are how the scheduler makes any rational decision. Memory limits, yes, set above real peaks to protect nodes. CPU limits are a per-workload judgment, since throttling can hurt latency-sensitive services; decide deliberately and document it.
They are the mechanism behind Kubernetes' self-healing reputation: readiness keeps traffic off pods that cannot serve, liveness restarts the wedged, startup protects slow boots. Without probes, the platform routes to dead pods and cannot distinguish broken from busy.
Running the defaults: a flat, policy-less network where any pod reaches any pod, over-broad RBAC bindings, and secrets in manifests. Default-deny network policies, least-privilege roles, and externalized secrets close the three most-exploited gaps.