Traefik ConsulCatalog defaultRule with Labels

Hey guys,

I’m trying to use a specific Label at my service definition as part of the URL.

---
apiVersion: v1
kind: Service
metadata:
  name: example0
  labels: 
    test: myapp0
spec:
  selector:
    app: example
  ports:
    - port: 80

With the defaultRule at the traefik command-CLI

...
- --providers.consulcatalog.defaultRule=Host("{{ regexReplaceAll `([^-].*)\-.*` .Name `$1` }}.{{ index .Labels `test`}}.k8s")
...

I only get example0…k8s.example.com; the value of my customLabel ‘test’ is missing.
I assume the label is missing in ConsulCatalog too.
How to check this? How to bring the Label from K8s to Consul Catalog?

Hey @Raskosk

You can set either tags or meta via annotations on your k8s service and that will show up in consul catalog.