Kubernetes CKA sample exam question 3 with answer

Question
Create a new deployment called web-proj-268 with, image nginx:1.16 and 1 replica.
Next, upgrade the deployment to version 1.17. using rolling update.
Make sure that the version upgrade is recorded in the resource annotation.

Answer
Create deployment:

kubectl create deployment web-proj-268 --image=nginx:1.16
After creation - it is mandatory to check:
kubectl get deploy
kubectl get po
kubectl describe deploy web-proj-268
Change image and record it:
kubectl set image deployment web-proj-268 nginx=nginx:1.17 --record
Verify:
kubectl describe deploy web-proj-268 | grep -i image
Check rollout history:
kubectl rollout history deployment web-proj-268
you should get as output the recording in the CHANGE-CAUSE column.