
Probes are used by kubelet in Kubernetes to indicate the container health and the state in a pod.
A probe can be a http probe or tcp probe to verify the health. (Flow Diagram of different probes)

Attributes used in defining probes


Startup Probes: Used to check if the application inside the Container has started
Readiness Probes: Used to check if the application is ready to use and serve the traffic.
Liveness Probes: Used to check if the container is available and alive.
Startup Probes:
- It can be used for slow starting containers with legacy applications.
- It indicates if the application inside the Container has started.
- If a startup probe is provided, liveness and readiness probes wait to start after it.
- After the startup probe has succeeded, the liveness probe takes over to provide a fast response.
- In below example, if /manage/health request fails 3 times, it will restart the container.
startupProbe:
httpGet:
path: /manage/health
port: 8080
initialDelaySeconds: 60
timeoutSeconds: 90
periodSeconds: 10
failureThresold: 3
Readiness Probes:
- It helps kubelet to understand if container in pod is ready to be used
- Once the container in the pod ready, traffic is sent from service to this backend pod
- The logic of checking application dependencies like database/kafka/redis and/or other services the application are implemented in readiness probe.
- During rolling updates, it is used by kubelet to keep the old container up and running while checking new pods to be ready for actual traffic.
- It runs on the container during its whole lifecycle.
- Incorrect implementation of it may result in an ever-growing number of processes in the container.
- In below example, if /manage/health request fails 3 time, it won’t serve any traffic
readinessProbe:
httpGet:
path: /manage/health
port: 8080
initialDelaySeconds: 60
timeoutSeconds: 90
periodSeconds: 10
failureThresold: 3
Liveness Probes:
- It is used to indicate if the container has started and is alive or not
- It could catch a situation, where an application is running, but unable to make progress.
- Restarting a container in such a state can help to make the application available.
- It doesn’t wait for readiness probes to succeed. If you want to wait before executing a liveness probe you should use initialDelaySeconds or a startupProbe.
- In below example, if /manage/health request fails 3 times, it will restart the container.
livenessProbe:
httpGet:
path: /manage/health
port: 8080
initialDelaySeconds: 60
timeoutSeconds: 90
periodSeconds: 10
failureThresold: 3













