Guide

Getting a Deployment to Ready in a sandbox is the easy part. Production Kubernetes fails in other ways. Pods are oversized or undersized. Probes restart healthy processes. A node drain evicts every replica at once. A rollout ships a bad image faster than anyone notices. This topic is the operational layer on top of core concepts. It covers how to keep services alive under load, during deploys, and during cluster maintenance.

Walking through the topic

The first two pages cover what a pod is allowed to use and when it counts as healthy. The last four cover how it scales, survives maintenance, rolls out, and gets packaged.

StepConceptWhat it answers
1Resource requests, limits and QoSHow much may a pod use, and what happens when it goes over?
2Health probesWhen does a pod get traffic, and when does it restart?
3Autoscaling pods and nodesHow do replicas and nodes grow with load?
4Disruption budgets and spreading replicasHow do drains and node failures avoid taking everything down?
5Rollouts and graceful terminationHow does a deploy swap pods without dropping requests?
6Packaging, GitOps and operatorsHow are manifests packaged, applied and pinned?

Common mistakes

  • Putting a database check on liveness. A dependency blip then restarts every pod at once.
  • Setting CPU limits far below the real burst. Throttling looks like slowness, and average CPU hides it.
  • No PodDisruptionBudget on a customer-facing service. A drain can remove every replica.
  • Ignoring SIGTERM. Every deploy then drops in-flight requests.
  • Mutable image tags. A tag can be pushed again. Pin digests.

Production readiness checklist

Before calling a service production-ready on Kubernetes:

  1. Requests and limits are set, and the QoS class is intentional. No BestEffort for serving pods.
  2. Readiness and liveness probes are set, plus a startup probe if boot is slow. Liveness stays shallow.
  3. A PodDisruptionBudget with maxUnavailable, and at least three replicas for HA services.
  4. Replicas are spread across zones and nodes.
  5. An HPA or KEDA with floors and ceilings, and cluster capacity to absorb a scale-up.
  6. Graceful shutdown is tested under real load, with a preStop hook if the mesh needs time.
  7. Images are pinned by digest, scanned, run as non-root, with a read-only root filesystem where possible.
  8. A default-deny NetworkPolicy in the namespace, where the platform supports it.
  9. Dashboards for RED, pod restarts, throttling and OOM kills, with burn-rate alerts from SLOs.
  10. A runbook for CrashLoop, Pending, ImagePull, OOM and a failed rollout.

Key takeaways

  • Requests drive scheduling and autoscaling. Limits drive throttling and OOM kills.
  • Readiness removes traffic. Liveness restarts processes. Never mix them.
  • The HPA scales pods, the cluster autoscaler scales nodes, and KEDA scales on events.
  • PodDisruptionBudgets and topology spread keep maintenance from becoming an outage.
  • Graceful termination is part of every zero-downtime deploy.
  • Package with Kustomize or Helm, deliver with GitOps, and pin digests.

Interview angle

Two questions come up often. "What happens if liveness checks the database?" The answer is a restart storm. "Why is my pod Pending?" Check resources, affinity, taints, PVCs and quota, in that order.

Further learning

Carson Anderson's deconstruction helps when production symptoms point at controllers and networking rather than app code. Rewatch the scheduling and endpoints sections when pods stick Pending or Services go dark.

Kubernetes Deconstructed: Understanding Kubernetes by Breaking It Down - Carson Anderson, DOMOCNCF [Cloud Native Computing Foundation]
Horizontal Pod Autoscaling (official docs)In Kubernetes, a HorizontalPodAutoscaler automatically updates a workload resource (such as a Deployment or StatefulSet), with the aim of automatically scaling capacity to match demand. Horizontal scaling means that t…Kubernetes Configure Liveness, Readiness and Startup ProbesThis page shows how to configure liveness, readiness and startup probes for containers. For more information about probes, see Liveness, Readiness and Startup Probes. Before you beginYou need to have a Kubernetes clus…Kubernetes Argo CD documentationArgo CD - Declarative GitOps CD for Kubernetesargo-cd.readthedocs.io Karpenter documentationJust-in-time Nodes for Any Kubernetes Clusterkarpenter.sh KEDA documentationHow you can start with KEDA as new userKEDA