morla
morla

Reputation: 755

cant create file for livenessProbe and redinessProbe

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

Upvotes: 0

Views: 2419

Answers (2)

Vikram Jakhar
Vikram Jakhar

Reputation: 742

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

Upvotes: 1

Rajesh Deshpande
Rajesh Deshpande

Reputation: 853

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"]

Upvotes: 2

Related Questions