Bird
0
0

How can you combine a TCP liveness probe with an exec probe to check both port availability and a custom command in a pod spec?

hard📝 Application Q9 of 15
Kubernetes - Health Checks and Probes
How can you combine a TCP liveness probe with an exec probe to check both port availability and a custom command in a pod spec?
AUse two separate probes: livenessProbe with tcpSocket and readinessProbe with exec
BDefine both tcpSocket and exec under the same livenessProbe
CUse only tcpSocket because exec is not supported with TCP probes
DUse exec probe with a curl command to check TCP port
Step-by-Step Solution
Solution:
  1. Step 1: Understand probe types

    Kubernetes does not support combining tcpSocket and exec in one probe.
  2. Step 2: Use separate probes

    You can use livenessProbe with tcpSocket and readinessProbe with exec to check different things.
  3. Final Answer:

    Use two separate probes: livenessProbe with tcpSocket and readinessProbe with exec -> Option A
  4. Quick Check:

    Separate probes for tcpSocket and exec = Use two separate probes: livenessProbe with tcpSocket and readinessProbe with exec [OK]
Quick Trick: Use separate probes for tcpSocket and exec checks [OK]
Common Mistakes:
  • Trying to combine tcpSocket and exec in one probe
  • Ignoring readinessProbe for exec checks
  • Using exec probe incorrectly for TCP port

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes