exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 12 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 12
Topic #: 1
[All Professional Cloud Developer Questions]

You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster. The application exposes an HTTP-based health check at /healthz. You want to use this health check endpoint to determine whether traffic should be routed to the pod by the load balancer.
Which code snippet should you include in your Pod configuration?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B
For the GKE ingress controller to use your readinessProbes as health checks, the Pods for an Ingress must exist at the time of Ingress creation. If your replicas are scaled to 0, the default health check will apply.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
wanrltw
5 months, 2 weeks ago
B: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
upvoted 1 times
...
omermahgoub
1 year, 3 months ago
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.
upvoted 3 times
...
fanilgor
1 year, 7 months ago
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.
upvoted 3 times
fanilgor
1 year, 7 months ago
On 10th read, It's more likely they mean the initial phase of the lifecycle so it's B. But the wording here is terrible. Hopefully they refined the question in the real exam.
upvoted 1 times
...
...
tomato123
1 year, 8 months ago
B is correct
upvoted 2 times
...
ruben82
1 year, 11 months ago
B is correct according with https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
upvoted 1 times
...
nazonazonazo
2 years, 2 months ago
https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features ingress backendconfig can set healthCheck, but this resource can not set httpGet ``` apiVersion: cloud.google.com/v1 kind: BackendConfig metadata: name: my-backendconfig spec: healthCheck: checkIntervalSec: INTERVAL timeoutSec: TIMEOUT healthyThreshold: HEALTH_THRESHOLD unhealthyThreshold: UNHEALTHY_THRESHOLD type: PROTOCOL requestPath: PATH port: PORT ```
upvoted 1 times
...
wilwong
2 years, 9 months ago
B is correct
upvoted 2 times
...
syu31svc
2 years, 10 months ago
https://cloud.google.com/kubernetes-engine/docs/concepts/ingress: "GKE can infer some or all of the parameters for a health check if the Serving Pods use a Pod template with a container whose readiness probe has attributes that can be interpreted as health check parameters. See Parameters from a readiness probe for implementation details and Default and inferred parameters for a list of attributes that can be used to create health check parameters. Only the GKE Ingress controller supports inferring parameters from a readiness probe." B is correct
upvoted 3 times
yuchun
2 years, 10 months ago
yes, readness probe is for checking if the pod can accept traffic.
upvoted 2 times
...
...
saurabh1805
3 years, 5 months ago
B is correct answer https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes
upvoted 2 times
meh_33
1 year, 7 months ago
B correct
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago