Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Google Cloud Certified Professional Cloud Developer · Google Cloud
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
Option B is the correct code snippet to include in the Pod configuration in order to use the /healthz endpoint as a readiness probe. The liveness probe, specified in option A, is used to determine whether the application is running and responsive. If the liveness probe fails, the application is considered to be in a failed state and will be restarted. The readiness probe, specified in option B, is used to determine when a Pod is ready to receive traffic. If the readiness probe fails, the Pod will not receive traffic from the load balancer until it becomes healthy again. Option C, loadbalancerHealthCheck, is not a valid field in a Pod configuration. Option D, healthCheck, is also not a valid field in a Pod configuration.
Readiness probe marks the pod as "Running" and can START accepting traffic. However, after the pod is in a "Running" state, the Liveness probe comes in and acts as the health check for the entire lifecycle of the pod. So think of it this way. The pod passes its initial check (readiness), accepts traffic for a while then crashes (logically, the pod can still be "Running"). The Liveness probe is responsible for detecting it. Otherwise, the LB could still pass traffic to a pod that can't serve traffic. Therefore, I believe it's A.