☸️ The Pod That Was Technically Running and Never Actually Doing Anything
Init containers are designed to run to completion, in order, before any of a pod’s main containers start – which is exactly the right model for setup work like waiting on a dependency or seeding a config file, but becomes a silent trap the moment one of them doesn’t actually exit. A pod with a hung or endlessly retrying init container shows up as Running or Init:0/1 in kubectl get pods, which doesn’t scream ‘stuck’ the way CrashLoopBackOff does, so it’s easy to assume the application itself is just slow to start rather than realize it has never been given the chance to start at all.
🔎 The Problem
spec:
initContainers:
- name: wait-for-db
image: busybox
command: ['sh', '-c', 'until nc -z postgres 5432; do sleep 2; done']
containers:
- name: app
image: myapp:latest
# If "postgres" is misspelled, on a different port, or the network
# policy silently blocks this pod from reaching it, this init
# container loops forever - it never fails, never crashes, just never
# finishes. kubectl get pods shows:
#
# NAME READY STATUS RESTARTS AGE
# myapp-xy 0/1 Init:0/1 0 47m
#
# The main "app" container has never run even once.
✅ Fix: Give Init Containers a Timeout and Watch Init Status, Not Just Pod Status
- Build an explicit timeout into any init container’s wait logic (a maximum retry count, or a bounded sleep loop) so a genuinely unreachable dependency fails loudly instead of looping silently forever.
- Check kubectl describe pod and specifically the Init Containers section and its events, not just the top-level pod status line, since that’s where the actual stuck command and its output are visible.
- Add resource requests/limits and a liveness-style self-check even to init containers where it makes sense, so Kubernetes has a mechanism to notice and restart one that’s wedged rather than one that appears to be making progress forever.
⚠️ Why This Is Easy to Miss
- Init:0/1 looks like ordinary startup progress rather than a stuck state, especially on a pod that’s expected to take a little while to come up, so it’s common to just wait longer before investigating.
- There’s no error, no crash loop, and no log output from the main container at all to search through, because that container has never started – the only evidence is in the init container’s own logs, which people often forget to check separately.
A pod stuck in Init isn’t failing – it’s waiting, patiently and silently, for a gate that may never open on its own.





