World map

 

BM: Baca dalam Bahasa Melayu

World K2: Trays & Orders

Deployments: the standing order

You will learn: how a Deployment, its ReplicaSet and its pods fit together.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

A ReplicaSet keeps 3 trays of nginx 1.29. The menu moves to 1.30, so you edit its template. What happens to the 3 trays already out?

Pick one answer.

Watch

You are here: cluster kind-dev namespace default
Applying shop.yaml makes the Deployment shop, one ReplicaSet and 3 pods. Their names share the start shop-. Terminal output: $ kubectl apply -f shop.yaml deployment.apps/shop created $ kubectl rollout status deployment/shop --timeout=120s Waiting for deployment "shop" rollout to finish: 0 of 3 updated replicas are available... deployment "shop" successfully rolled out $ kubectl get deploy,rs,pods NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/shop 3/3 3 3 10s NAME DESIRED CURRENT READY AGE replicaset.apps/shop-747bf9cf8 3 3 3 10s NAME READY STATUS RESTARTS AGE pod/shop-747bf9cf8-9wfbg 1/1 Running 0 10s pod/shop-747bf9cf8-gqqzd 1/1 Running 0 10s pod/shop-747bf9cf8-wxnbw 1/1 Running 0 10s

A Deployment: The manager's standing order, like "always 3 trays". is the manager’s standing order: “always 3 trays of this dish”. It makes a ReplicaSet, which makes the pods. Three layers, one file.

Try it

Who makes whom? Put the one you write at the top.

The one you write at the top. Put these in order. Use the arrows, or drag.

  • ReplicaSet shop-747bf9cf8: the Deployment makes it
  • Pods shop-747bf9cf8-…: the ReplicaSet makes them
  • Deployment shop: you write this

Try it

Your turn. Apply shop.yaml. When all 3 trays are up, change the order to 4.

You are here: cluster kind-dev namespace default

Want 0. See 0. All good.

Want0written on the order for shop
See00 ready
Do All goodGaps fixed: 0
Stalls: 3. Trays: 0 (0 ready). Waiting for a stall: 0.
dev-control-planeOpenManager

No trays here.

dev-workerOpen

No trays here.

dev-worker2Open

No trays here.

Time: +0s (sped up)

Predict

Someone deletes the ReplicaSet shop-747bf9cf8. Its 3 trays go with it. What does the Deployment do?

Pick one answer.

Check

You are here: cluster kind-dev namespace default
The ReplicaSet is deleted. The Deployment makes a ReplicaSet with the same name and 3 new pods. Terminal output: $ kubectl apply -f shop.yaml deployment.apps/shop created $ kubectl rollout status deployment/shop --timeout=120s Waiting for deployment "shop" rollout to finish: 0 of 3 updated replicas are available... deployment "shop" successfully rolled out $ kubectl delete rs -l app=shop replicaset.apps "shop-747bf9cf8" deleted from default namespace $ kubectl rollout status deployment/shop --timeout=120s Waiting for deployment "shop" rollout to finish: 0 of 3 updated replicas are available... deployment "shop" successfully rolled out $ kubectl get rs NAME DESIRED CURRENT READY AGE shop-747bf9cf8 3 3 3 7s

The ReplicaSet came back with the same name. Its name comes from the template, so same template, same name. The trays inside are new.

You did it!

You can now explain how a Deployment, its ReplicaSet and its pods fit together.

Go deeper (optional)

Read a pod name from the left. shop is the Deployment. 747bf9cf8 comes from the template (the pod-template-hash label). The last part is random. To close the shop for good, delete the Deployment, not its pods.

Real rep (optional): on a throwaway cluster, run kubectl get deploy,rs,pods --show-labels.