DiamondLightSource / DiamondLightSource/fastcs
Liveness checking for container orchestration
- Dominant language
- Python
- Stars
- 6
- Forks
- 8
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 3
Description
#### What is a liveness probe
"The [kubelet](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/) uses liveness probes to know when to restart a container. For example, liveness probes could catch a deadlock, where an application is running, but unable to make progress. Restarting a container in such a state can help to make the application more available despite bugs.
A common pattern for liveness probes is to use the same low-cost HTTP endpoint as for readiness probes, but with a higher failureThreshold. This ensures that the pod is observed as not-ready for some period of time before it is hard killed." - https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
#### Example of a liveness probe definition
```
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: liveness
image: registry.k8s.io/busybox
args:
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600
livenessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
```
#### Proposal
A new cli command `check-liveness `. It could be useful to automatically serve an additional endpoint for each type of transport to be used in liveness testing. `check-liveness` tests if each transport is responsive. It is up to each transport to provide a method that can be called as a test.
Contributor guide
Assessment
This issue has not been assessed yet.