Scaling
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 12 of 45.
The number of Pods a Deployment runs is its replica count, and you can change it at any time:
kubectl scale deployment web --replicas=3Kubernetes answers deployment.apps/web scaled and starts two more Pods. kubectl get pods now shows three, each with its own generated name.
Scaling down works the same way: ask for fewer replicas and the extra Pods are deleted. You can also choose the count when creating the Deployment:
kubectl create deployment web --image=nginx --replicas=2The Deployment table shows the effect at a glance: READY 3/3 means all three replicas are up. Scaling is how you handle more traffic without changing anything about the application itself.
Challenge
BeginnerCreate a Deployment named web from the nginx image, scale it to 3 replicas, then show the web Deployment to confirm 3/3 are ready.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to Kubernetes
Practice on your own: Terminal playground