-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow to route to invididual containers (e.g. variable substitution in frontend.rule) #2578
Comments
Actually personally I'd want this in rancher. But docker would be nice, too, of course. |
Hi, It could be a nice feature ! I'll try to custom config_container.go on a fork. Regards, |
A templating of default |
i noticed this issue upgrading to 1.5.x from 1.4 . this really needs to be configurable at a global level. currently we have integrations with the old naming and 1.5 breaks this. |
I have been also stuck at 1.4, also require a global setting (essentially backwards compatible). I wanted to upgrade to 1.5.x to leverage the backend http basic auth. |
It seems rancher does not expose the individual containers but only services with containers in them: So I think the config would need to split up the individual containers from |
Thanks for all the work y'all do, Traefik is great and I want to keep using it, but.. this issue seems to have stalled since April, and I arrived here from Google because I, too, am getting stuck with Traefik 1.5+. I'd love to be able to set a global default pattern such as |
This comment has been minimized.
This comment has been minimized.
I have a different use case for this feature. I'd like to run a number of services within a single stack accessible via a different Here's a quick example (Invoked with: services:
app:
image: app
deploy:
labels:
- "traefik.frontend.rule=Host: dev-app.example.com"
api:
image: api
deploy:
labels:
- "traefik.frontend.rule=Host: dev-app.example.com"; PathStrip: /api/" What I'd like to do: services:
app:
image: app
deploy:
labels:
- "traefik.frontend.rule=Host: Host:{project_name}-{service}.{domain}"
api:
image: api
deploy:
labels:
- "traefik.frontend.rule=Host: Host:{project_name}-{service}.{domain}"; PathStrip: /api/" I'm aware this isn't a support forum but it's vaguely related to this. All of my Host rules come up like |
I'm also interested in this feature. I'd love to stick to the default generated names but for my organization dealing with multiple levels of nested hostnames below the root name makes dealing with SSL certs and hostnames quite a bit more difficult. The option to use a pattern like |
As a cheap solution, traefik could allow |
Hey y'all, as we do not support version one anymore, I am going to close this issue. Thanks! |
Summary
Traefik changed the default frontend rule from
Host:{containerName}.{domain}
toHost:{service}.{project_name}.{domain}
(see #1235). This breaks setups and makes some setups very difficult or impossible (e.g. see #1787): You can't easily attach to individual container. You'd need a manual frontend rule for each container. Or each container would need it's own service name.Possible solutions
Host:{containerId}.{service}.{project_name}.{domain}
(Rancher:Host:{containerId}.{serviceName}.{domain}
) for invidual container andHost:{service}.{project_name}.{domain}
(Rancher:Host:{serviceName}.{domain}
) for a group of containers. Exposing individual containers could be a config flag:traefik.<service-name>.exposeIndividualContainerBy=<id|name|false>
{containerName} {containerId} {service} {projectName} {domain}
.traefik.frontend.rule=Host:{containerName}.{domain}
would actually work as expected.What did you do?
I've set a label:
traefik.frontend.rule=Host:{containerName}.{domain}
My container is called
sampleName
, my domain issampleDomain
What did you expect to see?
A route to
sampleName.sampleDomain
.What did you see instead?
A route to
{containerName}.{domain}
.The text was updated successfully, but these errors were encountered: