Container Connectivity Troubleshooting
This guide summarizes common connectivity issues we hit when running the router with Docker Compose or Kubernetes and how we fixed them. It also covers the “No data” problem in Grafana and how to validate the full metrics chain.
1. Use IPv4 addresses for backend endpoints
Symptoms
- Router/Envoy timeouts, 5xx, or “up/down” flapping in Prometheus. Curl from inside containers/pods fails.
Root causes
- Backend bound only to 127.0.0.1 (not reachable from containers/pods).
- Using IPv6 or hostnames that resolve to IPv6 where IPv6 is disabled/blocked.
- Using localhost/127.0.0.1 in the router config, which refers to the container itself, not the host.
Fixes
- Ensure backends bind to all interfaces: 0.0.0.0.
- In Docker Compose, configure the router to call the host via a reachable IPv4 address.
- On macOS, host.docker.internal usually works; if not, use the host’s LAN IPv4 address.
- On Linux or custom networks, use the Docker host gateway IPv4 for your network.
Example: start vLLM on the host
# Make vLLM listen on all interfaces
python -m vllm.entrypoints.openai.api_server \
--host 0.0.0.0 --port 11434 \
--served-model-name phi4
Router config example (Docker Compose)
# config/config.yaml (snippet)
llm_backends:
- name: phi4
# Use a reachable IPv4; replace with your host’s IP
address: http://172.28.0.1:11434
Kubernetes recommended pattern: use a Service
apiVersion: v1
kind: Service
metadata:
name: my-vllm
spec:
selector:
app: my-vllm
ports:
- name: http
port: 8000
targetPort: 8000
Router config then uses: http://my-vllm.default.svc.cluster.local:8000
Tip: discover the host gateway from inside a container (mostly Linux)
# Inside the container/pod
ip route | awk '/default/ {print $3}'