Google Cloud Professional Cloud DevOps Engineer — Question 97
You have an application that runs in Google Kubernetes Engine (GKE). The application consists of several microservices that are deployed to GKE by using Deployments and Services. One of the microservices is experiencing an issue where a Pod returns 403 errors after the Pod has been running for more than five hours. Your development team is working on a solution, but the issue will not be resolved for a month. You need to ensure continued operations until the microservice is fixed. You want to follow Google-recommended practices and use the fewest number of steps. What should you do?
Answer options
- A. Create a cron job to terminate any Pods that have been running for more than five hours.
- B. Add a HTTP liveness probe to the microservice's deployment.
- C. Monitor the Pods, and terminate any Pods that have been running for more than five hours.
- D. Configure an alert to notify you whenever a Pod returns 403 errors.
Correct answer: B
Explanation
The correct answer is B because adding a HTTP liveness probe to the deployment will ensure that the Kubernetes system can automatically restart the Pod if it becomes unhealthy, effectively handling the 403 errors. Option A is not ideal as it requires manual intervention, while option C also relies on manual monitoring and termination, and option D only provides notification without addressing the actual problem.