Interview Prep/Kubernetes/Pod startup failures

Pod goes to `RunContainerError` with `exec: "gunicorn": executable file not found in $PATH: unknown`.

BeginnerTroubleshootingPod startup failures
Answer

Likely causes → The command/args in the manifest overrides the image entrypoint with a binary that does not exist in this image (multi-stage build dropped it, virtualenv not on PATH, distroless image without a shell).

Diagnose →

kubectl get pod web-x -o jsonpath='{.spec.containers[0].command} {.spec.containers[0].args}'
docker run --rm --entrypoint sh registry.example.com/web:1.4 -c 'echo $PATH; which gunicorn'

Fix → Use the absolute path (/opt/venv/bin/gunicorn), fix PATH in the image, or remove the command override and let the image entrypoint run. Exit code 127 means not found; 126 means found but not executable (chmod +x in the Dockerfile).

Prevent → Keep the start command in the image, not in the manifest, so it is tested with the build.

All Kubernetes questions Roadmap: Kubernetes core

More on Pod startup failures