Exam CKA Topic 3 Question 57 Discussion

Actual exam question for Linux Foundation's CKA exam
Question #: 57
Topic #: 3
You have a Deployment for a web application named 'web-app-deployment' that uses an image named 'web-app:vl .0'. You want to implement a rolling update to upgrade the deployment to a new version, 'web-app:v2.0', but only allow a maximum of 2 pods to be unavailable at any time during the update. How would you achieve this using Kubernetes?

Suggested Answer:

See the solution below with Step by Step Explanation.
Explanation:
Solution (Step by Step) :
1. Update the Deployment YAML:
- Open the Deployment YAML file for 'web-app-deployment' (e.g., 'web-app-deployment.yaml').
- Modify the 'image' field within the 'spec.template.spec.containers' section to the new image: 'web-app:v2.0'.
- Adjust the 'strategy.rollingUpdate' section to control the rolling update process:
- Set 'maxUnavailable: 2' to allow a maximum of 2 pods to be unavailable at any time.
- Keep 'maxSurge: 0' if you don't want additional pods to be created during the update.

2. Apply the Updated Deployment: - IJse 'kubectl apply -f web-app-deployment.yaml' to apply the updated Deployment YAML. 3. Monitor the Rolling Update: - Use 'kubectl get pods -l app=web-app' to monitor the update process. You will see that Kubernetes will gradually terminate old pods running 'web-app:vl .0' and create new pods with 'web-app:v2.0'. - You can also use "kubectl describe deployment web-app-deployment' to observe the progress of the rolling update. 4. Verify Successful Update: - Once the update is complete, confirm that all pods are running the new image 'web-app:v2.0'. You can check the output of 'kubectl get pods -l app=web-app' or 'kubectl describe deployment web-app-deployment'.

by Phil at Dec 31, 2025, 06:57 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10