Poland
GRANDMETRIC Sp. z o.o.
ul. Metalowa 5, 60-118 Poznań, Poland
NIP 7792433527
+48 61 271 04 43
info@grandmetric.com
Sweden
Drottninggatan 86
111 36 Stockholm
+46 762 041 514
info@grandmetric.com
UK
Grandmetric LTD
Office 584b
182-184 High Street North
London
E6 2JA
+44 20 3321 5276
info@grandmetric.com
US Region
Grandmetric LLC
Lewes DE 19958
16192 Coastal Hwy USA
EIN: 98-1615498
+1 302 691 94 10
info@grandmetric.com
Providing reliable, high-availability applications is combined with the need to automate the control of the application state. Kubernetes provides a set of tools to facilitate this task. This article will focus on the Liveness probe object, I will show the applications of each type – TCP Socket, Command Execution, HTTP Request.
This kind of establishing a TCP connection to a pod (or pods) on the port specified in the configuration. This solution is especially useful for “non-HTTP” applications, for example Postfix mail server. Liveness probe tries to connect to pod, if no connection fails, pod (or pods) will reboot.
Situation where everything is fine:
Example situation where container port mismatch with the port define in Liveness probe configuration (like close port in real situation):
In this case, liveness probe will execute the command inside the container and check the returned status. The container is restarted when a status other than 0 is returned
Situation where everything is fine:
Example with problem:
This case is very helpful when maintaining WEB applications. Liveness prob recurring polls the endpoint responsible for restoring the health of the application. Returning a status from the 4xx and 5xx family will qualify the pod (pods) for restart.
Situation when health status endpoint return 2xx status code:
Situation when endpoint return status code 4xx or 5xx:
In this article, I would like to illustrate how individual Liveness probes work. Specific examples to use once with all side options are described in Design & Config.
Leave a Reply