Skip to content

Containers can’t reach each other via FQDN through Caddy in Podman setup #63

@m0canu1

Description

@m0canu1

I have a Rocky Linux host with Podman.
• The host has a private IP (let’s say 192.168.1.1).
• There is a Caddy container running with socket activation (like example4). This container is connected to two Podman networks: caddy-grafana and caddy-prometheus.
• Grafana runs in its own container and is attached to caddy-grafana.
• Prometheus runs in its own container and is attached to caddy-prometheus.
• In the Caddyfile, I configured two domains:
• grafana.example.com → Grafana
• prometheus.example.com → Prometheus

From outside the host everything works correctly. When I open grafana.example.com or prometheus.example.com in a browser, I reach the right service.

The issue: inside the Grafana container, if I try to connect to prometheus.example.com, DNS resolves it to the host IP (192.168.1.1), but the connection doesn’t work.

How can I make containers reach each other through their FQDNs, the same way it works from outside?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions