DOC: phronis-cl
STATUS: ● PUBLISHED
SYSTEM PHRONIS

You Can't Bind to a ClusterIP: Redpanda on Kubernetes

A networking lesson about pod interfaces versus Service IPs.

Cover image — You Can't Bind to a ClusterIP: Redpanda on Kubernetes

Redpanda ran fine in docker-compose. The first time it started in Kubernetes, it crashed immediately:

posix_listen failed: Cannot assign requested address  (10.96.207.132:33145)

The address it couldn’t bind to was its own Service ClusterIP. That’s the lesson hiding in the crash.

// 01 — THE SETUP

The manifest told Redpanda to listen on its RPC address, set to the service name phronis-redpanda:33145. In Compose, a service name resolves to the container, and binding works. In Kubernetes, the same name resolves to something different.

// 02 — THE CULPRIT

phronis-redpanda in the cluster resolves to a Service ClusterIP, a virtual address owned by kube-proxy, not by any pod’s network interface. A process can only bind() to an address that exists on its own interfaces. The ClusterIP isn’t one of them, so the listen syscall fails with “cannot assign requested address.” The pod was trying to bind an IP it doesn’t own.

// 03 — THE FIX

Separate where you listen from how others reach you:

--rpc-addr=0.0.0.0:33145              # bind all local interfaces
--advertise-rpc-addr=phronis-redpanda:33145   # tell peers to route via the Service

Bind 0.0.0.0 (every interface the pod actually has), and advertise the Service name so other pods still route to it through Kubernetes. Listen locally, advertise globally.

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.