0

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
  • 675
  • 4
  • 15
  • 32

2 Answers2

2

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"]
  • Gosh, I was searching for this for hours... Can't figure why my python cmd could not find my file... – Toodoo Feb 15 '22 at 15:18
1

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
  • 712
  • 1
  • 5
  • 13