Closed pikeas closed 1 week ago
For your use case, you can configure each caddy to use a different label prefix. See --label-prefix
or CADDY_DOCKER_LABEL_PREFIX
in the readme.
If you configure for example one caddy to monitor labels with prefix "caddy-p", and the other to monitor labels with "caddy-i". Then you can choose which caddy instance containers should target by defining labels like:
caddy-p: service-a.internal-corp.company.com
caddy-p.reverse_proxy: "{{upstreams 1111}}"
Or even expose a service on both caddy by writing labels twice.
That will not only reduce the warn messages, but will reduce the overhead of processing unnecessary labels.
This is exactly what I'm looking for, thank you!
The README mentions --label-prefix
in a code block under the Caddy CLI section, which is easy to miss. Please consider adding a "Running multiple Caddies" section to the docs.
I have two Caddy instances:
And a bunch of services:
The issue is that the intranet Caddy sees the public labels, and vice versa:
Everything is configured as intended, service-b attaches to only the public network and can't see the intranet Caddy. Because Caddy has a Docker socket from a management node, it sees the labels for every Swarm service and thinks service-b is misconfigured.
Possible changes: