Google Cloud Professional Cloud Developer — Question 166

You need to configure a Deployment on Google Kubernetes Engine (GKE). You want to include a check that verifies that the containers can connect to the database. If the Pod is failing to connect, you want a script on the container to run to complete a graceful shutdown. How should you configure the Deployment?

Answer options

Correct answer: B

Explanation

The correct answer is B because it utilizes a livenessProbe to check the container's connection to the database, allowing Kubernetes to manage the Pod's lifecycle effectively. The other options either use incorrect mechanisms for checking connectivity or do not handle the shutdown process correctly.