0

Having a bit of trouble trying to get a readiness probe command working. Every external service / app of ours exposes an /up endpoint whose body contains the SHA of the current release. I’m trying to create a readiness probe that hits this URL locally and then compares the content of the response body against the expected release. Basically, if 200 OK && ${BODY} == ${RELEASE} then we’re good to go.

I’m trying to translate this to the following probe, but I’m having constant issues:

... heaps of yaml ...
            readinessProbe:
              exec:
                command: [ "/bin/sh", "-c", "wget", "-q", "-O", "//RELEASE", "localhost:5000/up", "&&", "grep", "-E", "'^${DEPLOYMENT_RELEASE}$'", "//RELEASE" ]
... even more heaps of yaml meight ...

Which results in the following error:

Readiness probe failed: wget: unrecognized option: E BusyBox v1.28.4 (2018-07-17 15:21:40 UTC) multi-call binary. Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE] [--header 'header: value'] [-Y|--proxy on/off] [-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL... Retrieve files via HTTP or FTP --spider    Only check URL existence: $? is 0 if exists -c  Continue retrieval of aborted transfer -q   Quiet -P DIR    Save to DIR (default .) -S Show server response -T SEC Network read timeout is SEC seconds -O FILE  Save to FILE ('-' for stdout) -U STR    Use STR for User-Agent header -Y on/off Use proxy

I’ve tried a few variations on the above, all resulting in similar errors:

wget -q -O /RELEASE localhost:5000/up; grep -E '^${DEPLOYMENT_RELEASE}$' /RELEASE

and even:

[[ $(wget -qO- localhost:5000/up) == ${DEPLOYMENT_RELEASE} ]]

Breaking the command up into a list doesn’t seem to help either. It has to be some mundane syntactic error, or some misinterpretation of the manual.

This command works if I execute it from within a running pod.

Unfortunately, I can't modify the images directly, so I have to find out some other way to perform this check. Perhaps via a side car or something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.