Skip to content

fix: serve default bind address 127.0.0.1 → 0.0.0.0#14

Open
chaosreload wants to merge 1 commit intozerobootdev:mainfrom
chaosreload:fix/serve-bind-address
Open

fix: serve default bind address 127.0.0.1 → 0.0.0.0#14
chaosreload wants to merge 1 commit intozerobootdev:mainfrom
chaosreload:fix/serve-bind-address

Conversation

@chaosreload
Copy link
Copy Markdown

Problem

zeroboot serve binds to 127.0.0.1 by default, which breaks any container or networked deployment:

  • Kubernetes: kubelet readiness/liveness probes connect from the Pod IP, not localhost → probes always fail → Pod never becomes Ready
  • Docker: health checks and docker exec traffic arrive via bridge network IP
  • Any load balancer / reverse proxy: traffic forwarded to container IP is silently dropped

Fix

Change the default bind address to 0.0.0.0 (all interfaces) and add a --bind flag for explicit control:

# Default — works in containers, K8s, behind LBs
zeroboot serve python:/workdir/python 8080

# Explicit localhost — for local development
zeroboot serve python:/workdir/python 8080 --bind 127.0.0.1

Backwards compatibility

The only behavior change is the default bind address. Existing local setups are unaffected in practice (loopback connections still work when the server listens on 0.0.0.0). Users who explicitly want localhost-only can pass --bind 127.0.0.1.

zeroboot serve previously bound to 127.0.0.1, which breaks container
environments where health probes and traffic arrive on the Pod/container
IP rather than localhost:

  - Kubernetes: kubelet readiness/liveness probes connect from Pod IP
  - Docker: health checks connect via bridge network
  - Any reverse proxy or load balancer forwarding to the container

Change the default bind to 0.0.0.0 (all interfaces) and add a --bind
flag so users can still restrict to localhost for local development:

  zeroboot serve python:/workdir/python 8080              # 0.0.0.0 (default)
  zeroboot serve python:/workdir/python 8080 --bind 127.0.0.1  # localhost only

The ZEROBOOT_BIND env var in the Docker entrypoint passes through to this
flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant