Use this when managing stateless apps with Deployments.
Deployments
Deployments manage stateless pods through ReplicaSets, handling rolling updates, rollbacks with kubectl rollout undo, scaling and self-healing of failed pods.
1. Deployments manage ReplicaSets with rolling updates.
2. Readiness probes gate rollout.
3. maxSurge/maxUnavailable.
4. Rollback with undo (or git revert in GitOps).
5. Record image digests.
new spec → rollout → ready pods → done
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as schema drift, selector overreach, admission rejection, controller lag, immutable fields, stale status and confusing created object with ready workload, choosing the cases most relevant to spec.selector/template identity, generation/observedGeneration, ReplicaSet rollout, readiness/availability conditions and rollback history.
Step 2 Example Narrow the fault
kubectl apply -f deploy.yaml
kubectl rollout status deploy/web
kubectl rollout undo deploy/web
Step 3 Common mistakes Narrow the fault
- No readiness probe, so traffic hits pods that are not ready.
- No resource requests/limits.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Deployments manage ReplicaSets and rolling updates.
- kubectl rollout undo reverts.
- Readiness probes decide when pods get traffic.
kubectl rollout status deploy/<n> -n <ns>— rolloutkubectl rollout history deploy/<n>— revisionskubectl rollout undo deploy/<n>— rollback
ReferenceWhy it matters1 section · depth on demand
What it is
A Deployment manages ReplicaSets to keep a number of identical pods running and performs rolling updates.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A Deployment manages a set of identical pods for a stateless application and handles rolling updates: when the pod template changes, it replaces pods gradually so the application stays available.
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate: { maxUnavailable: 0, maxSurge: 1 }
template:
spec:
containers:
- name: api
image: registry.example.com/net-api:2.3.1
readinessProbe: { httpGet: { path: /ready, port: 8080 } }
kubectl rollout status deploy/net-api --timeout=5m
kubectl rollout history deploy/net-api
kubectl rollout undo deploy/net-api
Readiness probes are what make rolling updates safe: without them, Kubernetes sends traffic to pods that have started but are not ready.
Mechanics
The linked authority for bounded mechanics is Kubernetes Docs — Deployments; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Kubernetes Automation > Deployments. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For spec.selector/template identity, generation/observedGeneration, ReplicaSet rollout, readiness/availability conditions and rollback history, prefer typed fields and stable IDs over human presentation text.