QuestionQ97

VerifiedDeploying applications

You need to configure a Deployment on Google Kubernetes Engine (GKE). You want to add a check to confirm that the containers can connect to the database. If the Pod cannot connect, you want a script in the container to run and perform a graceful shutdown. How should you configure the Deployment?

Explanation

A liveness probe can check database connectivity and, after its failure threshold is reached, Kubernetes terminates and restarts the unhealthy container. A PreStop lifecycle handler is invoked immediately before termination, including termination caused by a liveness-probe failure, allowing the container’s graceful-shutdown script to run.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!