Kubernetes Deployments
Learn why Deployments are the standard way to run stateless applications and how they manage ReplicaSets and pods.
What Is a Deployment?
A Deployment is a higher-level Kubernetes resource for managing stateless applications. It keeps the desired number of pod replicas running and supports rolling updates and rollbacks.
Why Not Run Pods Directly?
A bare pod is fragile. If it dies, nothing automatically recreates it unless a controller manages it.
A Deployment gives you:
- self-healing through managed replicas
- easy scaling
- rolling updates
- rollback support
Deployment, ReplicaSet, and Pods
Deployment → ReplicaSet → Pods
Deployment
my-app
replicas: 3 · strategy: RollingUpdate
ReplicaSet
my-app-7d9f4
desired: 3 · ready: 3
Pod
Pod 1
Pod
Pod 2
Pod
Pod 3
ReplicaSet Relationship
A Deployment usually manages one active ReplicaSet and may keep older ReplicaSets around for rollout history and rollback.
Sub-pages in This Section
| Sub-topic | What you will learn |
|---|---|
| Create Deployments | Write YAML, apply it, scale it, and inspect ReplicaSets |
| Rolling Updates | Understand rollout strategy and image updates |
| Rollbacks | Revert changes safely and inspect rollout history |
When Deployments Fit Best
Deployments are ideal for:
- web APIs
- frontend services
- stateless background workers
For stateful systems like databases, Kubernetes often uses other controllers such as StatefulSets.
Think of a Deployment as the manager that keeps the right number of identical workers on shift and replaces them when one leaves.
Deployment Benefit
Why are Deployments usually preferred over creating bare pods directly?
Immediate Child Resource
What resource does a Deployment directly manage?