I am having an issue with passing a pipe character |
in readiness probe command.
I want to have a probe command:
curl --silent http://localhost:8080/actuator/health | grep --quiet -e '^{\"status\"\:\"UP\".*}$'
Here is how I have defined the probe:
# kubectl get pod my_pod -o yaml
readinessProbe:
exec:
command:
- curl
- --silent
- http://localhost:8080/actuator/health
- '|'
- grep
- --quiet
- -e
- '''^{\"status\"\:\"UP\".*}$'''
Readiness probe fails with a message:
Readiness probe failed: curl: option --quiet: is unknown curl: try 'curl --help' or 'curl --manual' for more information
The error can be reproduce when command is executed without pipe character |
:
curl --silent http://localhost:8080/actuator/health grep --quiet -e '^{\"status\"\:\"UP\".*}$'
For some reason pipe is not interpreted by Kubernetes.
Can you please help me with passing pipe in deployment?