Bird
0
0

Which YAML snippet correctly configures an HTTP liveness probe for a Kubernetes container that checks the /healthz endpoint on port 8080 every 10 seconds?

easy📝 Configuration Q3 of 15
Kubernetes - Health Checks and Probes
Which YAML snippet correctly configures an HTTP liveness probe for a Kubernetes container that checks the /healthz endpoint on port 8080 every 10 seconds?
AlivenessProbe: exec: command: ["curl", "-f", "http://localhost:8080/healthz"] periodSeconds: 10
BlivenessProbe: httpGet: path: /healthz port: 8080 periodSeconds: 10
CreadinessProbe: httpGet: path: /healthz port: 8080 periodSeconds: 10
DlivenessProbe: tcpSocket: port: 8080 periodSeconds: 10
Step-by-Step Solution
Solution:
  1. Step 1: Identify the probe type

    The question asks for an HTTP liveness probe, so the key must be livenessProbe with an httpGet action.
  2. Step 2: Check the path and port

    The probe should check the /healthz path on port 8080, which is correctly specified in livenessProbe: httpGet: path: /healthz port: 8080 periodSeconds: 10.
  3. Step 3: Verify the periodSeconds

    livenessProbe: httpGet: path: /healthz port: 8080 periodSeconds: 10 sets periodSeconds: 10, matching the requirement to check every 10 seconds.
  4. Final Answer:

    livenessProbe: httpGet: path: /healthz port: 8080 periodSeconds: 10 correctly configures the HTTP liveness probe.
  5. Quick Check:

    Probe type and HTTP path/port correct [OK]
Quick Trick: Use livenessProbe with httpGet, specify path and port [OK]
Common Mistakes:
  • Using readinessProbe instead of livenessProbe
  • Using exec or tcpSocket instead of httpGet
  • Incorrect indentation or missing keys
  • Wrong port or path specified

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes