A probe lets Kubernetes check whether a container is healthy and able to serve traffic. Liveness checks support restarting unhealthy containers, while readiness checks indicate whether a container should receive traffic. section 1.2.2
Choose the probe mechanism that matches the workload. HTTP services expose a health endpoint, other network services accept TCP connections, and workloads without service endpoints can run a Bash script. section 4.1.6
Probe mechanisms include:
- HTTP: call an endpoint such as /healthz; HTTP 200 means success, while another response or a timeout means failure. section 4.1.6
- TCP: attempt to open a connection, which suits TCP services such as SMTP. section 4.1.6
- Bash script: execute custom tests for workloads such as batch jobs; a nonzero exit code means failure. section 4.1.6
TCP readiness configuration
A TCP-based service can use a readiness probe that waits 15 seconds before checking port 25, repeats every 30 seconds, and requires one successful check or one failure according to the configured thresholds. section 4.1.6
readinessProbe:
initialDelaySeconds: 15
periodSeconds: 30
tcpSocket: #1
port: 25 #1
successThreshold: 1
failureThreshold: 1
#1 TCP probe specification
Inspect the probe configuration showing initial delay, checking interval, TCP port, and success and failure thresholds. section 4.1.6

