Kubernetes 101 : TCP liveness probe

The kubelet uses liveness probes to check if the containers inside the pods are running and are not "hanging". 
If the liveness probe fails, the kubelet restarts the container.

A TCP liveness probe represents a type of the liveness probes, it connects to a TCP port on the container.
The TCP liveness probe is usually used when the container does not support HTTP communications.

Below is an example of a TCP liveness probe example that connects to a "redis" the container :

The liveness probe connects to port TCP number "6379".

The "initialDelaySeconds" is the waiting time for the kubelet before it performs the initial, first probe.

We could check the results of the TCP liveness probe using the below command:

We could find that information in the "events" section of the output of the above command.


Leave as a comment: