-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service tags containing a comma #719
Comments
Hi @AndyL4N : can you provide any relevant log messages that occur when you try to register a service with a comma in a service tag? [EDIT]: no longer needed, see comment below. I'm not yet familiar with using
|
@david-yu: bringing to your attention as I believe this is a limitation on the The consul-k8s/control-plane/connect-inject/annotations.go Lines 41 to 43 in 7423b10
consul-k8s/control-plane/connect-inject/endpoints_controller.go Lines 416 to 419 in 7423b10
|
Hi @AndyL4N Could you tell us more about your use case? Have you enabled Connect or are you using mainly Catalog Sync? I believe likely do expect commas to separate tags, but I wonder if you attempted to escape that whole tag somehow with with a single or double quote? |
Hi @david-yu. Currently we are only using Service Sync without Connect. Sure, we tried many options to escape commas and tags with quotes, double quotes, braces and brackets, backslashes and even replacing with HTML code symbols. Same for escaping only tag values and whole tag line. As I see in listing above it has no sense because whole annotation tag string splits only by commas without any other logic. For example this annotations: annotations: 'consul.hashicorp.com/service-sync': 'true' 'consul.hashicorp.com/service-tags': |- env=prod, solution=SupperApp, traefik.enable=true, traefik.http.middlewares.app-ipwhitelist.ipwhitelist.sourcerange=192.168.1.0/24, traefik.http.middlewares.app-redirect-https.redirectscheme.scheme=https, traefik.http.routers.app-http.middlewares=app-redirect-https,app-ipwhitelist, will be splitted to something like this: consul catalog services -tags | grep app my-service-in-consul app-ipwhitelist,env=prod,solution=SupperApp,traefik.enable=true, traefik.http.middlewares.app-ipwhitelist.ipwhitelist.sourcerange=192.168.1.1/24, traefik.http.middlewares.app-redirect-https.redirectscheme.scheme=https, traefik.http.routers.app-http.middlewares=app-redirect-https Trying to escape whole tag with double quotes doing a similar thing: my-service-in-consul "traefik.http.routers.app-http.middlewares=app-redirect-https, env=prod, app-ipwhitelist",solution=SupperApp,traefik.enable=true, traefik.http.middlewares.app-ipwhitelist.ipwhitelist.sourcerange=192.168.1.1/24, traefik.http.middlewares.app-redirect-https.redirectscheme.scheme=https, Or only tag value, for example with single quotes: my-service-in-consul traefik.http.routers.app-http.middlewares='app-redirect-https, env=prod, app-ipwhitelist',solution=SupperApp,traefik.enable=true, traefik.http.middlewares.app-ipwhitelist.ipwhitelist.sourcerange=192.168.1.1/24, traefik.http.middlewares.app-redirect-https.redirectscheme.scheme=https, If it requires, I can send you more variants, but result will be the same. And the case is to register service with Traefik-specific parameters for configuration discovery. Usually these parameters can have many tags contain commas-separated values like headers, endpoints, middlewares, rules and even Regexp expressions. |
Using |
Good afternoon. Any news on this issue? We can make a fix and use a special separator for a non-sign "," |
@lkysow can we release a fix for this problem as a fix-release??? |
Will be in our next release! |
Consul uses comma-separated service tags notation.
But using traefik proxy with consul catalog I found some complications to setup multiple middlewares or entrypoints, required comma in value. For example:
Here Consul will split the second middleware to another tag
Of course, in consul terminology, this does not match the architecture. But the flexibility of the traefik-consul-kubernetes stack is very efficient. Maybe there is some workаround?
The text was updated successfully, but these errors were encountered: