Question
What is a difference between a readinessprobe and a livenessprobe besides how the corresponding fields are used in defining a Pod using YAML?
Answer
At most a failed liveness probe will result in the restarting of a container. At most a failed readiness probe will result in the removing a pod from the endpoint of a service (page 150 of Kubernetes in Action).
Another difference is that the kubectl get po
command will show the results of "liveness" pods only indirectly -- in the "RESTARTS" column. The livenessprobe has the ability to signal to the kubelet that the container must be restarted. (The kubelet could be used to restart the container without the liveness probe.)
The kubectl get po
command will show a variety of statistics, and one column in the results of this command is "READY". The "0/1" value would indicate that zero containers out of one are ready based on the readiness probe failing. This is a direct indication of the readiness probe in the kubectl get po
command's results.
To learn more, you may want to read this posting by Colin Breck or this posting on the Kubernetes.io website.