fix(k8s): translate service names to localhost for sidecar containers #989

Merged
AFDudley merged 1 commits from fix-sidecar-localhost into main 2026-02-03 23:13:28 +00:00
Owner

In docker-compose, services can reference each other by name (e.g., 'db:5432').
In Kubernetes, when multiple containers are in the same pod (sidecars), they
share the same network namespace and must use 'localhost' instead.

This fix adds translate_sidecar_service_names() which replaces docker-compose
service name references with 'localhost' in environment variable values for
containers that share the same pod.

Fixes issue where multi-container pods fail because one container tries to
connect to a sibling using the compose service name instead of localhost.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

In docker-compose, services can reference each other by name (e.g., 'db:5432'). In Kubernetes, when multiple containers are in the same pod (sidecars), they share the same network namespace and must use 'localhost' instead. This fix adds translate_sidecar_service_names() which replaces docker-compose service name references with 'localhost' in environment variable values for containers that share the same pod. Fixes issue where multi-container pods fail because one container tries to connect to a sibling using the compose service name instead of localhost. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AFDudley added 1 commit 2026-02-03 23:11:46 +00:00
fix(k8s): translate service names to localhost for sidecar containers
Some checks failed
Lint Checks / Run linter (push) Failing after 3s
Lint Checks / Run linter (pull_request) Failing after 4s
Deploy Test / Run deploy test suite (pull_request) Failing after 4s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 5s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Failing after 4s
Webapp Test / Run webapp test suite (pull_request) Failing after 5s
Smoke Test / Run basic test suite (pull_request) Failing after 5s
019225ca18
In docker-compose, services can reference each other by name (e.g., 'db:5432').
In Kubernetes, when multiple containers are in the same pod (sidecars), they
share the same network namespace and must use 'localhost' instead.

This fix adds translate_sidecar_service_names() which replaces docker-compose
service name references with 'localhost' in environment variable values for
containers that share the same pod.

Fixes issue where multi-container pods fail because one container tries to
connect to a sibling using the compose service name instead of localhost.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AFDudley merged commit 4a1b5d86fd into main 2026-02-03 23:13:28 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#989
No description provided.