livenessProbe/readinessProbe command for ingress-nginx

Jbn1233
Nov 12, 2023

--

In some case URL probe (httpGet) is not the answer, So use liveness command probe instead.

        livenessProbe:
exec:
command:
- /bin/sh
- -c
- curl --fail -o /dev/null -sS -m 2 http://127.0.0.1:10254/healthz
failureThreshold: 5
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3

readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl --fail -o /dev/null -sS -m 2 http://127.0.0.1:10254/healthz
failureThreshold: 5
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3

Note: older curl may not support “ — fail” option

That’s all for today.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet