Bird
0
0

Which of the following YAML snippets correctly defines a readiness probe using a TCP socket in a Kubernetes pod spec?

easy📝 Configuration Q3 of 15
Kubernetes - Health Checks and Probes
Which of the following YAML snippets correctly defines a readiness probe using a TCP socket in a Kubernetes pod spec?
AreadinessProbe: tcpSocket: port: 3306 initialDelaySeconds: 5 periodSeconds: 10
BreadinessProbe: httpGet: path: /health port: 3306 initialDelaySeconds: 5
CreadinessProbe: exec: command: ["curl", "-f", "http://localhost:3306"] periodSeconds: 10
DreadinessProbe: tcpSocket: path: /ready port: 3306 periodSeconds: 10
Step-by-Step Solution
Solution:
  1. Step 1: Identify valid readiness probe types

    Readiness probes can be httpGet, tcpSocket, or exec.
  2. Step 2: Check tcpSocket syntax

    tcpSocket requires only a port number, no path.
  3. Step 3: Validate options

    readinessProbe: tcpSocket: port: 3306 initialDelaySeconds: 5 periodSeconds: 10 correctly uses tcpSocket with port and timing fields.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    tcpSocket needs port only, no path [OK]
Quick Trick: tcpSocket readiness probe requires only port, no path [OK]
Common Mistakes:
  • Adding path under tcpSocket
  • Using httpGet with wrong port or missing path
  • Misusing exec command syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes