DOC: phronis-in
STATUS: ● PUBLISHED
SYSTEM PHRONIS

The Init Container That Couldn't Reach localhost

Init containers run to completion before the main one starts, so 'localhost' is empty.

Cover image — The Init Container That Couldn't Reach localhost

The MinIO pod never reached Running. Its init container (there to create the storage bucket) kept exiting with connection refused to localhost:9000. The thing it was trying to reach was the very container that hadn’t started yet.

// 01 — THE SETUP

The MinIO pod had an init container whose job was to create a bucket on first deploy. It did so by calling the MinIO API at localhost:9000, the same pattern that worked in docker-compose.

// 02 — THE CULPRIT

Kubernetes init containers run to completion before the main container starts. That’s their entire purpose: guaranteed-before setup. But it means when the init container called localhost:9000, MinIO itself wasn’t running yet. In a pod, init and main containers share a network namespace (so localhost is the same pod), but the main container is, by definition, not up while the init container runs. It was knocking on a door before anyone moved in.

// 03 — THE FIX

Remove the init container entirely:

# k8s/minio.yaml — initContainers section deleted

For a development deployment, creating the bucket on first write is sufficient. The application makes it when it needs it. The init container was solving a problem that didn’t need solving in this context, and its very ordering guarantee made it impossible.

TAKEAWAYS

NEXT

@frogwebp brand mark
ANTHONY PENA · @FROGWEBP
I build data systems and write about everything around them, the architecture, the failures, what each one teaches me. Documenting in public since 2021: the process, not just the result.

// NEWSLETTER — THE BUILD LOG SIGNAL

When I ship something or learn something worth keeping, it lands here first — build logs, concepts, and the honest process behind them. Come along; no spam, leave anytime.