Skip to content
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

Add the app's default labels to the traefik container #401

Closed
wants to merge 1 commit into from
Closed

Add the app's default labels to the traefik container #401

wants to merge 1 commit into from

Conversation

anoldguy
Copy link
Contributor

Add the same service/destination labels used by the app containers to the traefik containers.

I'm sure there's a better way to do this.

I'm also sure there's a reason why we don't want to do this, in case traefik ends up fronting several app backends at once? I don't know if there's work to support that, but IIRC, there was talk about deploying everything on a single box, which could require traefik supporting multiple backends.

In any case, I'd love to discuss this concept, as we have a need to get log data from traefik tagged with these values. The app containers already have these values, but traefik does not.

The admittedly simple alternative is to just drop this into config/deploy.yml:

traefik:
  labels:
    service: app_name # like 'bcc'

and then in each destination config:

traefik:
  labels:
    destination: staging | production | whatever

test/integration/app_test.rb is failing, but all other tests are passing. I'm not sure it's not something in my env.

Add the same service/destination labels used by the app containers to the traefik containers
@anoldguy anoldguy marked this pull request as draft July 25, 2023 12:35
@anoldguy anoldguy changed the title feat(traefik): Add default labels Add the app's default labels to the traefik container Jul 25, 2023
Copy link
Collaborator

@djmb djmb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to run multiple services on a single VM, but they'll all share the same Traefik instance.

This is a bit messy - the Traefik config will be based on whichever project you run the last traefik reboot from.

Given that I think its best not to automatically apply the labels - with multiple services they could be misleading. Your suggestion to add them manually to the config sounds like the best plan 👍

@anoldguy anoldguy closed this Jul 25, 2023
@anoldguy anoldguy deleted the label-traefik-same-as-workload branch July 25, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants