Based on what you've shared, I have 2 theories about what might be wrong.
(Most likely) Since you didn't provide a full command output from inside container (i.e. curl
vs curl ... | grep ...
) I can assume that the grep
version inside conatiner is working different than expected. This is usually happens with more complex commands (e.g. when using -E), but it worth checking a full piped pair.
(Less likely) Weird idea, but maybe YAML itself is not resolved correctly? Try to make it as simple as possible to 2x check:
startupProbe:
exec:
command: ["sh", "-c", "curl -s -f http://localhost:8080/v1/health | grep -q -e '\"status\":\"healthy\"'"]
If this doesn't work, try to make it verbose and check the Pod logs:
startupProbe:
exec:
command:
- echo "PROBE DEBUG"
- curl -v http://localhost:8080/v1/health
- sh
- -c
- >
curl http://localhost:8080/v1/health |
grep -e '\"status\":\"healthy\"'
- echo "$?"