cant create file for livenessProbe and redinessProbe

1/30/2019

hy folks

I'm currently trying to set up the livenessProbe and readinessProbe. After starting the container I ask to create an empty file touch /tmp/healthy.

However i don't know why it can't create it. I looked at the kubernet site and examples on the internet and from what I could see everything seems correct.

The liveness send me back this answear Liveness probe failed: cat: can't open '/tmp/healthy': No such file or directory

Thank you for your help

https://gist.github.com/zyriuse75/5c79f7f96e4a6deb7b79753bde688663

-- morla
kubernetes
kubernetes-health-check
kubernetes-helm

2 Answers

1/30/2019

I think you should write /bin/sh in commad and -c touch /tmp/healthy in args fields as below:

command: ["/bin/sh"]
args: ["-c", "touch /tmp/healthy"]
-- Rajesh Deshpande
Source: StackOverflow

1/30/2019

Please, correct the value of imagePullPolicy in the YAML, its value should be Always not allways. Might be this is the issue that's why /tmp/healthy not getting created.

Recheck you YAML with kubernetes docs

-- Vikram Jakhar
Source: StackOverflow