switchboard icon indicating copy to clipboard operation
switchboard copied to clipboard

Multiple target services for External DNS

Open AmilcarM11 opened this issue 1 year ago • 1 comments

Currently switchboard only allows selecting one Traefik target service for external-dns integration. This works great when there is a single LoadBalancer-type service for Traefik.

I have recently found a use-case where I need to have two LoadBalancer-type services for the same Traefik deployment:

  • The default service, exposing traefik's web and websecure entrypoints on a first Load Balancer (AWS NLB); which uses private IPs.
  • The second service, to expose a new entrypoint (let's call it websecure2), also pointing to port 443 of a second AWS NLB, which is internet-facing and uses public IPs.

This way I can expose webhooks to the internet, while keeping the rest of my API private. This is particularly useful for pre-production environments that require callbacks from external services. But this feature would also be helpful if there were multiple Traefik instances deployed on the same cluster.

Could there by a way to register more than one target service, and then select the desired one with an annotation on the IngressRoute object, so that the correct IP is used for the generated DNSEndpoint? For backwards compatibility, there could be a way to set the default target.

Let me know what you think!

AmilcarM11 avatar Jun 08 '23 10:06 AmilcarM11

The easiest way to achieve this with the current version of Switchboard is to run two instances of Switchboard that target the different Traefik instances.

These two Switchboard instances can already select ingresses based on the value of the kubernetes.io/ingress.class annotation.

Since I think that Switchboard is pretty lightweight, I would rather recommend to run two instances than to increase its complexity :eyes:

borchero avatar Jun 13 '23 08:06 borchero