You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying Agent Relay and PostgreSQL from Docker Compose to a local kind Kubernetes cluster, why does Agent Relay fail to connect to PostgreSQL when the database host is set to localhost, and what should be changed?
Answer
localhost refers to the current container/pod, not to another Kubernetes service. Therefore, when Agent Relay runs in its own pod, setting the PostgreSQL host to localhost makes it try to find PostgreSQL inside the Agent Relay container.
The solution is to expose PostgreSQL through a Kubernetes Service and use the Service DNS hostname as the database host.
After applying the Kubernetes manifests, the connection can be verified from the Agent Relay pod with:
kubectl get pods
kubectl get services
kubectl logs deployment/agent-relay
This is different from Docker Compose, where the Compose service name can also be used for container-to-container communication. In Kubernetes, the equivalent mechanism is the Kubernetes Service and its DNS name.
For a local kind cluster, the Agent Relay image also needs to be available inside the cluster. If the image is built locally, it can be loaded with:
Activity
github-actions commentedon Sep 24, 2026
✅ FAQ NEW proposal created in PR #418
Please review and approve the changes.