Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Cloud Developer Exam - Topic 15 Question 126 Discussion

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?
B) Create the Deployment with a livenessProbe for the container that will fail if the container can't connect to the database. Configure a Prestop lifecycle handler that runs the shutdown script if the container is failing.
A) Create two jobs: one that checks whether the container can connect to the database, and another that runs the shutdown script if the Pod is failing.
C) Create the Deployment with a PostStart lifecycle handler that checks the service availability. Configure a PreStop lifecycle handler that runs the shutdown script if the container is failing.
D) Create the Deployment with an initContainer that checks the service availability. Configure a Prestop lifecycle handler that runs the shutdown script if the Pod is failing.

Google Professional Cloud Developer Exam - Topic 15 Question 126 Discussion

Actual exam question for Google's Professional Cloud Developer exam
Question #: 126
Topic #: 15
[All Professional Cloud Developer Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: B

https://cloud.google.com/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke#make_sure_your_applications_are_shutting_down_in_accordance_with_kubernetes_expectations


Contribute your Thoughts:

0/2000 characters
Tammara
3 days ago
I agree with B, it’s the most efficient way to handle this!
upvoted 0 times
...
Lawana
8 days ago
C seems a bit off. PostStart checks after the container starts, not before.
upvoted 0 times
...
Cherry
14 days ago
Wait, can a Prestop really run if the Pod is already failing?
upvoted 0 times
...
Twana
19 days ago
I think A is better. Jobs are more reliable for checks.
upvoted 0 times
...
Gertude
24 days ago
Option B sounds right with the livenessProbe and Prestop handler.
upvoted 0 times
...
Quentin
29 days ago
I recall that PreStop handlers are important for graceful shutdowns, so option B could be the most effective approach here.
upvoted 0 times
...
Sommer
1 month ago
I think we practiced something similar where we used lifecycle hooks. Option C seems plausible, but I’m not confident about the PostStart handler.
upvoted 0 times
...
Corrinne
1 month ago
I'm not entirely sure, but I feel like using an initContainer in option D might not be the best choice since it runs before the main container starts.
upvoted 0 times
...
Annmarie
1 month ago
I remember we discussed livenessProbes in class, and I think option B sounds right since it directly checks the container's health.
upvoted 0 times
...

Save Cancel