You have an application deployed on Google Kubernetes Engine using a Deployment named echo-deployment. The deployment is exposed using a Service called echo-service. You need to perform an update to the application with minimal downtime to the application. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Use kubectl set image deployment/echo-deployment.
Why this is the answer
The correct approach is to use kubectl set image deployment/echo-deployment. This command performs a rolling update, which is Kubernetes' default strategy for updating Deployments. It gracefully replaces old Pods with new ones, ensuring minimal downtime by maintaining a specified number of available Pods throughout the update process. Using the rolling update functionality of the Instance Group behind the Kubernetes cluster is incorrect because GKE Deployments manage Pod updates, not the underlying Instance Group. Instance Group updates would affect the entire node, not just the application Pods. Deleting and recreating the deployment (kubectl delete deployment/echo-deployment followed by kubectl create -f) would cause significant downtime as all old Pods are terminated before new ones are created. Updating the service YAML file and then deleting/recreating the service is incorrect because the Service defines how to access the application, not the application's container image. Updating the service won't change the application version running in the Pods.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed