Definition
What it is
A Deployment does not run Pods directly. It creates a ReplicaSet, which creates Pods. When you update the Deployment's PodTemplate, it creates a new ReplicaSet with the new template, scales it up, and scales the old one down. That is the rolling update: no downtime, no lost requests, verified by the readinessProbe of each Pod.
Why it matters
Without a Deployment, you would manage bare Pods manually: create one, watch it crash, create another. Deployments automate the loop. They also give you kubectl rollout undo: one command reverts to the previous revision. That alone justifies their use.
Deployment vs ReplicaSet vs StatefulSet vs DaemonSet
Controller | Purpose | Pod identity | Storage |
|---|---|---|---|
Deployment | Stateless replicas + rolling update | Ephemeral | Shared (emptyDir) |
ReplicaSet | Enforce N replicas | Ephemeral | None |
StatefulSet | Stateful workloads | Stable ordinal + network | Per-Pod PVC |
DaemonSet | One Pod per node | Node-bound | HostPath |
The rolling update
Rolling update
Set the strategy
strategy.type: RollingUpdate. DefaultmaxSurge: 25%,maxUnavailable: 25%. Lower values = safer but slower.Readiness probe mandatory
Without a
readinessProbe, Kubernetes considers a new Pod ready immediately and shifts traffic before the app booted.Liveness probe for restarts
If the app hangs,
livenessProbefails and Kubernetes restarts it. Never share readiness and liveness endpoints.Rollback ready
kubectl rollout undo deployment/app. Uses therevisionHistoryLimit(default 10) retained ReplicaSets.
Common failures
Origin
ReplicationController was the original primitive (2014). Deployments were added in Kubernetes 1.2 (March 2016) to add rolling updates and rollback. They are now the default for stateless workloads. StatefulSets came in 1.9 (2017) for stateful needs.
Evidence
FAQ
- Deployment vs ReplicaSet?
A Deployment owns one or more ReplicaSets (one per revision). You almost never interact with a ReplicaSet directly.
- How do I rollback?
kubectl rollout undo deployment/name. Reverts to the previous ReplicaSet.- Does it work for databases?
No. Use StatefulSet. Deployments assume ephemeral Pod identity.
- What is maxSurge/maxUnavailable?
Controls how aggressive the rolling update is.
maxSurge: 1, maxUnavailable: 0= safest, slowest.
Connections
- kubernetes
- k8s-pod
- container
- container-image
- rolling-update
Kubernetes (2024). Deployments. https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
Wiggins, A. (2011). The Twelve-Factor App. https://12factor.net/
Pros and cons
Pros
- Rolling update without downtime when readinessProbe is correct.
- Rollback in one command: kubectl rollout undo.
- Declarative reconciliation applied continuously.
- Horizontal scaling is trivial.
- Revision history for audit via revisionHistoryLimit.
Cons
- Not for stateful workloads: no stable Pod identity.
- Without readinessProbe: traffic before the app is ready.
- Not zero-downtime by default: depends on maxSurge and maxUnavailable.
- Rollback does not revert data migrations.
Key numbers
Timeline
2014 — ReplicationController (v1.0).
2016 — Deployments GA (v1.2, March).
2017 — StatefulSet for stateful workloads (v1.9).
2019 — Argo Rollouts introduces progressive delivery.
2024 — Default strategy across ecosystems.
Core components
Deployment hierarchy
| name | role | type | launched |
|---|---|---|---|
| Deployment | Declarative spec + rollout strategy | controller | 2016 |
| ReplicaSet | Pod replicas at one revision | controller | 2014 |
| Pod | Runs containers | workload | 2015 |
| Service | Stable endpoint for Pods | networking | 2014 |
Learning path
Progression
Prerequisite
kubernetes, k8s-pod, container-image
This term
You are here.
Next
Semantic network
● broader ● narrower ● related
Used in the garden
- Mastering Database Schema Version Control: The DevOps Secret Weapon (5×)
- Unleash Linux Power: Bash Scripting Secrets for LatAm Founders (4×)
- How to Choose the Right Tech Stack for Your Startup in 2025 (2×)
- Mastering Headless: Directus & Next.js for Hyper-Efficient SaaS Devs (2×)
- Unleash Your Edge: Build a Free AI Content Generator with Gemini API (2×)
- Serverless Savings: Cut Cloud Costs by 40% with Elegant Patterns (1×)
- Mastering GPT-4: Crafting Prompts for Flawless JSON Output Every Time (1×)
- Beyond the K Plateau: Strategies for Hyper-Niche Dominance in LatAm SaaS (1×)
- Architecting API Dominance: Design a REST API That Scales From Day One (1×)
- Headless Directory Systems: Monopolizing Regional Web Traffic (1×)
- The Zero-Downtime WordPress Migration Blueprint for High-Stakes Sites (1×)
- Master Linux Automation: Bash Scripting Secrets for Solo IT Founders (1×)
- From Script to Microservice: Scaling Reporting Automation to 10K Daily Requests (1×)
- The Day 5,000 WooCommerce Products Demanded a File-Based CMS Migration (1×)
- The 20-Line Python Script That Guards Your SaaS Uptime (and Your Sanity) (1×)
Sources
Kubernetes (2024). Deployments. https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
Wiggins, A. (2011). The Twelve-Factor App. https://12factor.net/