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

[Feat]: Ability to customize service name per container/port #421

Open
1 task done
aleclerc-cio opened this issue Feb 5, 2024 · 1 comment
Open
1 task done
Labels
enhancement New feature or request

Comments

@aleclerc-cio
Copy link

aleclerc-cio commented Feb 5, 2024

What feature?

I'd like to have the ability to rename/customize the service name that is given to a particular container/port combination.

For example a docker-compose file like this:

services:
  service-a:
    ports:
    - 8080:8080
    - 8081:8081

Gives two urls:

https://service-a-ui-8080-<branch>-<random>.livecycle.run/
https://service-a-ui-8081-<branch>-<random>.livecycle.run/

I'd like the ability to override the urls to anything I would like: i.e.

# for service-a 8080
https://api-<branch>-<random>.livecycle.run/

# for service-a 8081
https://metrics-<branch>-<random>.livecycle.run/

Ideally, this would still work with the service discovery and PREEVY_BASE_URL documented here

Describe the solution you'd like

The existing preevy.expose label could be augmented to support an optional prefix of name=

Example:

preevy.expose: api=8080,metrics=8081

The only downside I can think of is if you might have multiple containers that would define a specific url, and this would have to be caught and have an error thrown (i.e. if two containers specified an api port to expose). This is an example of an invalid config:

services:
  service-a:
    ports:
    - 8080:8080
    labels:
      preevy.expose: api=8080
  service-b:
    ports:
    - 7777:7777
    labels:
      # both containers use api, this would be invalid
      preevy.expose: api=7777

Describe alternatives you've considered

  • Currently the only way I can think of doing this is to rename my containers

Additional context

See https://livecyclecommunity.slack.com/archives/C05S50C9Z5F/p1707144759493989

Add screenshots

No response

Record

  • I agree to follow this project's Code of Conduct
@aleclerc-cio aleclerc-cio added the enhancement New feature or request label Feb 5, 2024
@royra
Copy link
Collaborator

royra commented Feb 7, 2024

@aleclerc-cio please see #426 for a broader discussion of container labels, feedback welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants