
Answer-first summary for fast verification
Answer: readinessProbe: httpGet : path: /healthz port: 80
The correct answer is B because the `readinessProbe` is used to determine if a pod is ready to receive traffic. This is crucial for ensuring that the load balancer only routes traffic to pods that are fully operational and ready to handle requests. The `livenessProbe` (option A) is used to check if the pod is running and restart it if it's not, but it doesn't influence traffic routing. Options C and D are incorrect as they use non-existent Kubernetes fields (`loadbalancerHealthCheck` and `healthCheck`). Therefore, the correct snippet to include in your Pod configuration is option B, which properly sets up a readiness probe using the specified health check endpoint.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are deploying an application in a Google Kubernetes Engine (GKE) cluster. The application exposes an HTTP health check endpoint at /healthz. You need to configure the Pod to use this endpoint for load balancer health checks.
What YAML snippet should you add to your Pod configuration?
Example (correct any syntax errors if present):
livenessProbe:
httpGet:
path: /healthz
port: <application-port>
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: <application-port>
initialDelaySeconds: 5
periodSeconds: 10
A
livenessProbe: httpGet : path: /healthz port: 80
B
readinessProbe: httpGet : path: /healthz port: 80
C
loadbalancerHealthCheck: httpGet : path: /healthz port: 80
D
healthCheck: httpGet : path: /healthz port: 80
No comments yet.