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: support for service being defined in routerPattern #2953

Merged
merged 6 commits into from
Dec 19, 2021

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Dec 1, 2021

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for changelog and subsystem label(s) applied

See #2666 for background on this issue.

Documentation notes

We don't have any documentation describing what routerPatterns are, or how they are used/defined. routerPatterns are quite an important feature on kubernetes based deployments as they are required to be defined. Where in old openshift deployments they were optional.

Router patterns are used when creating the autogenerated routes that some services (nginx, node, varnish, python) have, if they have been enabled (which is the default)

The idea with the router patterns is that it defines how autogenerated routes domains are created. Typically router patterns are defined on the deployment target (kubernetes or openshift) object in the API, but a previous version of Lagoon introduced router pattern overrides at the project level.

For example, in previous version of lagoon, router patterns will typically be defined like this

routerPattern: "${environment}.${project}.lagoon.example.com"

The values within the router pattern that are ${environment} and ${project} are substituted for their respective Lagoon values. So you could end up with an autogenerated route for an nginx service that looks like this nginx.main.example-project.lagoon.example.com

This could be limiting for some users, even with being able to adjust the router pattern down to something like this, with dashes as the separator.

routerPattern: "${environment}-${project}.lagoon.example.com"

The resulting domain would be nginx.main-example-project.lagoon.example.com, which also may be limiting for users.

What this pull request does is allow a new substitution to be added to the router patterns for services, ${service}. This now means you can define the router pattern like this

routerPattern: "${service}-${environment}-${project}.lagoon.example.com"

Which will leave you with the domain nginx-main-example-project.lagoon.example.com

Closing issues

closes #2666

@shreddedbacon shreddedbacon marked this pull request as ready for review December 1, 2021 03:57
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.

allow seperator in autogenerated routes to be configureable
2 participants