silent
silent

Reputation: 16148

Any way to use k8s exec liveness probes in a distroless container image?

We have a background processing pod running on AKS which doesn't expose any HTTP (or other) endpoint. Thus we used the following exec liveness probe, which worked as we needed to:

# For the liveness probe we check if the file exists and was modified in the last minute. Original source: https://medium.com/spire-labs/utilizing-kubernetes-liveness-and-readiness-probes-to-automatically-recover-from-failure-2fe0314f2b2e
livenessProbe:
  exec:
    command:
    - /bin/sh
    - -c
    - '[ $(find /tmp/healthy -mmin -1 | wc -l) -eq 1 ] || false'

Now we had to migrate to a distroless image for our container. This obviously doesn't contain any shell anymore. So I'm wondering if there is still any possible way to use exec liveness probes or is this basically impossible with distroless containers?

Upvotes: 2

Views: 467

Answers (0)

Related Questions