Startup, Liveness and Readiness Probes on OpenShift

Daein Park
2 min readOct 8, 2020

--

As of OpenShift 4.5(Kubernetes 1.18), startup probe is graduated to beta. So we can configure it by default. Let’s look this new feature and existing ones in a nutshell.

What is the probe ?

Probe is health check of the running pods for certain purposes, it means if the check is failed, then specific action is conducted to the pods. Such as restarting the pods and blocking external accesses to the pods.

startup, liveness and readiness probes process chart.

There are 3 type probes at the moment. startup, liveness and readiness probes. startup probe is designed for slow starting containers, if it’s failed then the pod is restarted and it does not allow to start liveness and readiness probes until it’s succeeded.

Liveness probe is the same with startup probes, it’s just different coverage period on the pod lifecycle. It’s applied after startup Probe is successful, but if there is no startup probe, then it can start as soon as pod is running.

startup and liveness probes can specify just only “1” at the successThreshold , but readiness probe can use other value.

The above flow chart shows all probes relationship simply.

How to configure the probes ?

The configuration items are as follows, refer Configure Probes for more details.

initialDelaySeconds(default: 0, min: 0): number of seconds until initialize the first probe check.
periodSeconds(default: 10, min: 1): number of seconds for interval to execute the check.
timeoutSeconds(default: 1, min: 1): number of seconds for the executed check timeout.
successThreshold(default: 1, min: 1): minimum consecutive successes for successful evaluation. startup and liveness probes must be 1.
failureThreshold(default: 3, min: 1): consecutive failures until the check is evaluated as fail.

The configuration sample is here.

startupProbe:
httpGet:
path: /startup_healthz
port: 8080
failureThreshold: 20
periodSeconds: 2
livenessProbe:
httpGet:
path: /liveness_healthz
port: 8080
failureThreshold: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /readiness_healthz
port: 8080
failureThreshold: 3
periodSeconds: 3

Thank you for reading.

--

--

Daein Park
Daein Park

Written by Daein Park

Hi, I’m Daein working at Red Hat. Just do something fun :) Nothing happens, if you do nothing. #OpenShift #Kubernetes #Containers #Linux #OpenSource

No responses yet