Deployments
Manage replicas and rolling updates with a Deployment.
What you will be able to do
- Use a Deployment, not a bare pod.
- Set replicas for availability.
- Use rolling updates with readiness probes.
- Roll back with kubectl rollout undo.
In plain English
A Deployment owns ReplicaSets and pods. It keeps the desired replica count, performs rolling updates and supports rollback. Change the image or template to trigger a rollout.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:1.27-alpine
ports:
- containerPort: 80Your turn
EasyScale a deployment
Write the command that scales a deployment named web to 3 replicas.
BASH · starter
kubectl scaleCheck your understanding before moving on.
Knowledge checkQuestion 1
Which object performs rolling updates and keeps replicas running?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.