Bird
0
0

Which of the following is the correct YAML snippet to define a liveness probe using HTTP GET on path /health at port 8080?

easy📝 Configuration Q12 of 15
Kubernetes - Health Checks and Probes
Which of the following is the correct YAML snippet to define a liveness probe using HTTP GET on path /health at port 8080?
AlivenessProbe: httpGet: path: health port: 8080 initialDelaySeconds: 5 periodSeconds: 10
BlivenessProbe: exec: command: ["curl", "/health"] initialDelaySeconds: 5 periodSeconds: 10
ClivenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 5 periodSeconds: 10
DlivenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10
Step-by-Step Solution
Solution:
  1. Step 1: Check HTTP GET probe syntax

    The correct syntax uses httpGet with path starting with a slash and port as a number.
  2. Step 2: Validate each option

    livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 correctly uses /health and port 8080. livenessProbe: exec: command: ["curl", "/health"] initialDelaySeconds: 5 periodSeconds: 10 uses exec with curl incorrectly. livenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 5 periodSeconds: 10 uses tcpSocket which is different. livenessProbe: httpGet: path: health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 misses the leading slash in path.
  3. Final Answer:

    livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 -> Option D
  4. Quick Check:

    HTTP GET probe with correct path and port = livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 [OK]
Quick Trick: HTTP path must start with '/' and port is a number [OK]
Common Mistakes:
  • Missing leading slash in path
  • Using exec command incorrectly
  • Confusing tcpSocket with httpGet

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes