Hi ,
I am trying to execute readiness/liveness probe using bash script as below but not able to redirect script output to container logs or standard out. Is it not possible to to route logs from script to container logs ? Any suggestion
The stdout/stderr of probes is not really captured. You could write it to a file?
It seems like a plausible feature request, but we’re swimming in those right now and I would not want to make anyone think it is the sort of thing that can just be slapped together.
this is my script #/bin/bash count=tail /console.txt | grep “mysstring” | wc -lif [[ count -eq 1 ]] then echo "PROBE FAILEDdate" >> /fails.txt exit 1 fi if [[ count -eq 0 ]] then echo "PROBE ok date" >> /fails.txt exit 0 fi
and my yaml livenessProbe: initialDelaySeconds: 30 periodSeconds: 30 failureThreshold: 6 exec: command: ["/bin/sh","-c","/probe.sh"]
I don’t know about the tank… kind of new to Kubernetes scripts
Hi @thockin / @Jose_Taboada Did the solution worked at all. I would like like believe that if write to a file as script output it should be collected via any tool to show up these probe logs. I have the similar requirement and I just want to make sure this worked and not getting into any unforseen one’s before I start over. Appreciate thought !
ah , got it. I will try out the solution to redirect script stdout to file i.e. backed by EFS and collect logs off datadog agent. I will post the solution if works for me, thanks @thockin