a quick question. I know if the Kubernetes liveness probe fails, kubernetes will help restart the pod and try again. But how about the readiness probe fails? How can I also ask kubernetes to restart the pod?
api-group-0 0/1 Running 0 6h35m
Restart this pod can make it works. Thanks all!
There's no way to trigger pod restart within a readiness probe. As it was recommended in the comments, you should rely on liveness probe instead.
livenessProbe:
exec:
command:
- /opt/fissile/readiness-probe.sh
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 3
If you have concerns about readiness-probe.sh fails periodically and shouldn't trigger restart straight after the first failure, consider failureThreshold
setting. It will give this many tries before pod restart.