I'm looking for a approach where we can turn on/off liveness probe using configMap UI on Rancher, and same time it does not require redeployment of the pod.
In details : Assume the liveness probe is already been config on pod. Next I have a boolean flag and it is set false, so if false, liveness probe will stop probing on pod. At other time, if set boolean flag to true, liveness probe will resume probe. All these need to works without pod redeployment. Below is my draft idea:
- There's a configMap UI (configMap listed on Rancher) which hold the boolean flag to turn on/off liveness probe something like this :
app.liveness.probe.mode=false
- Next I want to absorb the above boolean flag into deployment.yaml with the conditional checking as below :
{{ if app.liveness.probe.mode }}
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 70
periodSeconds: 10
{{ end }}
- I'm not sure how to reference the configMap boolean flag on Rancher into the deployment.yaml file.
- Or is there any other approach to control the liveness probe on/off toggle without redeployment of pod.