
Answer-first summary for fast verification
Answer: Use kubectl set image deployment/echo-deployment <new-image>
The correct answer is A: Use kubectl set image deployment/echo-deployment <new-image>. This command will update the container image of the deployment and trigger a rolling update. During a rolling update, Kubernetes updates the containers in a deployment incrementally, ensuring that some instances of the application remain available while others are being updated. This minimizes downtime and maintains service availability. Options B, C, and D are either incorrect or more disruptive methods that do not provide the seamless update functionality needed for minimal downtime. Specifically, option B refers to instance groups, which are not relevant for a Kubernetes rolling update, while options C and D involve deleting resources, resulting in unavoidable downtime.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have an application deployed on Google Kubernetes Engine (GKE) using a Deployment named echo-deployment, which consists of multiple pods running the application. The deployment is exposed to external traffic using a Service called echo-service, allowing your application to be accessible. You need to perform an update to the application's container image with minimal downtime, ensuring that the service remains available to users during the update process. What should you do?
A
Use kubectl set image deployment/echo-deployment <new-image>
B
Use the rolling update functionality of the Instance Group behind the Kubernetes cluster
C
Update the deployment yaml file with the new container image. Use kubectl delete deployment/echo-deployment and kubectl create -f <yaml-file>
D
Update the service yaml file with the new container image. Use kubectl delete service/echo-service and kubectl create -f <yaml-file>