The Service Responsible for Kubernetes Pod Diagnostics: probe
Key point
probe checks liveness, readiness, and startup status to reduce downtime during Rolling Updates.
Details
Kubernetes' probe is a feature that lets the kubelet periodically diagnose containers. There are three diagnostic methods: ExecAction, TCPSocketAction, and HTTPGetAction, and results are classified as Success, Failure, or Unknown.
probe is used in three types depending on purpose.
- livenessProbe: Checks whether a container is alive. If it fails, the kubelet kills the container and restarts it according to the restart policy.
- readinessProbe: Checks whether a container is ready to receive requests. If it fails, the corresponding Pod IP is removed from the service endpoint, so no traffic is routed to it.
- startupProbe: Checks whether the application's initial startup has completed. Other probes do not operate until this succeeds, reducing deadlocks for slow-starting applications.
The role of readinessProbe is especially important during Rolling Update situations. If the existing Pod is taken down before the process inside the new Pod has fully started up, there may be no target to receive requests, causing downtime such as a 504 Bad Gateway.
In the example, it's assumed that it takes about 30 seconds for the server inside the Pod to start up. In this case, if you add a readinessProbe, it checks the httpGet health status at intervals of periodSeconds after initialDelaySeconds, and only receives traffic when HTTP 200 is returned.
If the response is 400 or 500, the corresponding Pod is considered abnormal and excluded from routing targets. In other words, readinessProbe is the key mechanism for determining whether a Pod can actually handle requests.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.