I successfully configured Traefik 2.x in my home Docker Swarm cluster to automatically expose services with certain labels at a variable subdomain:
docker:
swarmMode: true
exposedByDefault: false
network: web
defaultRule: 'Host(`{{ index .Labels "traefik.subdomainName" }}.example.com`)'
I want to implement this same behavior with Kubernetes Ingress instead. I have successfully set up a Kubernetes Ingress Controller with Traefik 1.7 following the examples in github and the excellent documentation, but found the documentation for using the 2.x CRD less complete and had no success in my attempt to follow it. Additionally, I cannot find any documentation of an available defaultRule
argument to the Kubernetes provider in Traefik, or any other similar features that might enable service autodiscovery with Traefik as a Kubernetes Ingress Controller.
I don't want to have to update Ingress rules every time someone exposes a service. How do I achieve the same functionality I have in Swarm with Kubernetes?
Thanks for your time.