`kubectl logs web-0 --previous` returns nothing useful and the container dies in under a second. How do you get inside it?
IntermediateTroubleshootingPod startup failures
Answer
Likely causes → The process exits before it writes logs (bad entrypoint, missing binary, crash in a wrapper script), so there is nothing to read.
Diagnose →
# Copy the Pod, override the command so it stays alive
kubectl debug web-0 -it --copy-to=web-0-debug --container=app -- sh
# Or attach an ephemeral debug container sharing the process namespace
kubectl debug -it web-0 --image=busybox:1.36 --target=app
# Check what the image would run
crane config registry.example.com/web:1.4 | jq '.config.Entrypoint, .config.Cmd'
Fix → Inside the copy, run the real entrypoint by hand and read the error. Typical findings: wrong path, missing shared library, script with CRLF line endings.
Prevent → Run the image locally in CI (docker run --rm image --version) as a smoke test before pushing.
More on Pod startup failures
A Pod shows `CrashLoopBackOff` with `RESTARTS 7` and events say `Back-off restarting failed container app`. Where do you start?BeginnerPod status is `ImagePullBackOff` and events show `Failed to pull image "registry.example.com/web:1.4.2": rpc error: code = NotFound desc = failed to pull and unpack image ... not found`.BeginnerEvents show `pull access denied for registry.example.com/web, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed`.BeginnerPulls from Docker Hub randomly fail with `toomanyrequests: You have reached your pull rate limit`.IntermediateA private registry with an internal CA fails with `x509: certificate signed by unknown authority` during image pull.IntermediateA new image works on laptops but on nodes the Pod crash-loops and logs show only `exec /app/server: exec format error`.Intermediate