An HTTP readiness probe checks if a container is ready to accept traffic by sending an HTTP request to a specified endpoint. If the probe succeeds, Kubernetes routes traffic to the container.
Click to reveal answer
beginner
What fields are essential to configure an HTTP liveness probe in a Pod spec?
Key fields include httpGet (with path and port), initialDelaySeconds, periodSeconds, and timeoutSeconds. These define how Kubernetes checks if the container is alive.
Click to reveal answer
beginner
How does Kubernetes react if an HTTP liveness probe fails repeatedly?
If the liveness probe fails multiple times, Kubernetes restarts the container to try to fix the problem and keep the application healthy.
Click to reveal answer
intermediate
What is the difference between readiness and liveness probes using HTTP?
Readiness probes check if the app is ready to serve traffic, while liveness probes check if the app is alive and should be restarted if not responding.
Click to reveal answer
beginner
Show a simple example of an HTTP readiness probe configuration in a Kubernetes Pod spec.
C. livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
D. livenessProbe:
httpGet:
url: http://localhost:8080/healthz
initialDelaySeconds: 5
periodSeconds: 10
Solution
Step 1: Review HTTP probe syntax
The correct HTTP probe uses httpGet with path and port keys.
Step 2: Identify the correct YAML structure
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10 correctly uses httpGet with path and port. livenessProbe:
httpGet:
url: http://localhost:8080/healthz
initialDelaySeconds: 5
periodSeconds: 10 is invalid because url is not a valid key.
Final Answer:
Correct HTTP liveness probe syntax with httpGet, path, and port -> Option B
Quick Check:
httpGet uses path and port keys [OK]
Hint: Use httpGet with path and port, not url [OK]
Common Mistakes:
Using 'url' instead of 'path' in httpGet
Confusing exec or tcpSocket probes with httpGet
Wrong indentation or missing keys
3. Given this probe configuration snippet in a pod spec:
But Kubernetes marks the pod as not ready even though the app is healthy. What is the likely problem?
medium
A. The probe path /ready is incorrect or not handled by the app
B. initialDelaySeconds is too high, delaying readiness
C. timeoutSeconds is too long, causing probe to fail
D. periodSeconds is too short, causing probe overload
Solution
Step 1: Check probe path correctness
If the app does not respond correctly to /ready, probe fails and pod is not ready.
Step 2: Evaluate timing parameters
initialDelaySeconds of 5 is reasonable; timeoutSeconds of 2 is short but typical; periodSeconds of 10 is normal.
Final Answer:
The probe path /ready is incorrect or not handled by the app -> Option A
Quick Check:
Probe path must match app endpoint [OK]
Hint: Check if probe path matches app endpoint exactly [OK]
Common Mistakes:
Ignoring probe path correctness
Changing timing values unnecessarily
Assuming timeoutSeconds causes readiness failure
5. You want to configure a Kubernetes HTTP readiness probe that waits 15 seconds after container start, then checks the path /health every 3 seconds, but fails the pod if no response within 1 second. Which is the correct probe configuration snippet?