@Legogris posted a new topic, subject "Consul Catalog routing via static configuration". It read:

   I have numerous entrypoints (tcp, udp and https(s)) and services from consul catalog routed via tags, all working fine.
    
    Now I have a service in Consul that is provided by a vendored software, where I have no control over the tag values. In this case, it is a database service where each instance has either the tag `active` or `replica`. I'd like to have a TCP router for a specific entrypoint to this service.
    
    Without any traefik-specific tags on the service, Traefik automatically creates HTTP services and routers. Can I override thisspecific service via static configuration (or COnsul KV) in any way? The "labels" mentioned in https://docs.traefik.io/reference/dynamic-configuration/consul-catalog/ seem to be ignored when specified in the configuration file and only picked up via tags on the Consul services.
    
    Is there any way I can do what I want, or do I need to spin up a secondary traefik instance only for this use-case?

Then @zespri (Andrew Savinykh) said

    Can you describe what you mean by "override this specific service via static configuration"? Override in which way? Can you give an example?
    
    **Update** : sorry, I did not notice " I'd like to have a TCP router for a specific entrypoint to this service." It makes sense.
    
    I personally never used consul catalog, but I wonder can you do what you want by providing configuration via File Provider instead for that?

To which @Legogris replied

    So let's say for example I have a consul service `foo` with two instances, one with tag `bar` and one with tag `baz`.
    
    I have a configured endpoint in traefik:
    [code] 
        [entrypoints.foo]
        address = "726.858.6535:1337
        
    [/code]
    
    I'd like to route the `foo` endpoint to the `foo` service, iff the service instance has the `bar` tag set.
    
    I understand I can use constraints (which are global so a bit cumbersome, but should be possible) to limit which instance gets routed.
    
    However, I see no way of avoiding Traefik routing this as a HTTP service rather than TCP without using service tags.

To which @Legogris replied

    zespri:
    
    > I personally never used consul catalog, but I wonder can you do what you want by providing configuration via File Provider  instead for that?
    
    That's pretty much what I'm trying to achieve actually, but after quite a bit of trial and error I still can't get Traefik to recognize my Consul service through the file provider - it's still gets designated as HTTP

So @zespri (Andrew Savinykh) replied

    Are you saying you create a `[tcp.routers]` but you believe that http router is being created instead?

Then @Legogris said

    Yes, even though I'm referencing the consul service by name. Verified this through the web dashboard.

To which @Legogris replied

    I just ended up solving this for myself by forking the software producing the service and hardcoding the traefik tags there - but I'm sure this is not an all-to-uncommon use-case for others.

After which, @zespri (Andrew Savinykh) added

    > Yes, even though I'm referencing the consul service by name. Verified this through the web dashboard.
    
    Are you specifying provider name?
    
    https://docs.traefik.io/v2.2/middlewares/overview/#provider-namespace


{'source': 'discourse', 'url': 'https://community.traefik.io/t/consul-catalog-routing-via-static-configuration/7041', 'title': 'Consul Catalog routing via static configuration', 'views': 480, 'has_accepted_answer': False, 'word_count': 531, 'like_count': 0, 'reply_count': 5, 'participant_count': 2, 'posts': 8, 'tags': 'consul-catalog tcp', 'author': '@Legogris', 'participants': '@Legogris, @zespri (Andrew Savinykh)', 'image_url': [None], 'created_at': '2020-07-23T08:14:24.364Z', 'last_posted_at': '2020-07-23T23:56:52.444Z'}