-
Notifications
You must be signed in to change notification settings - Fork 14
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
Implement conf.toml
Helm generation on-the-fly based on the domain (#954)
#1041
Conversation
FCM
|
Discussed: current solution creates separate init container for each domain, which is NOT the desired behaviour, as this may eventually break the Helm chart deployment with more and more domains being added (imagine 1000 init containers). Ideally we should have a single init container accepting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SleepySquash please, recheck my changes before merging.
…1041, #954) - add `conf-renderer` container and `template.sh` script generating YAML configuration per Ingress host - support YAML format in `Config.init()` for remote configuration parsing - use `try_files` for `/conf` Nginx route to return `$host` based configuration Co-authored-by: tyranron <tyranron@gmail.com> e23283b
Resolves #954
Synopsis
Helm should allow specifying different configuration for different domains.
Solution
This PR adds:
conf.toml
based on the$host
;.yaml
files based on the provided values.$host
based retrieval ofconf.toml
is the easy part-> nginx will try to get the
$host.toml
file first, and if fails to do so, then fallbacks toconf.toml
. E.g. if we arelocalhost
, then nginx will try to returnlocalhost.toml
instead ofconf.toml
by default.We need to cycle throughSee Implementingress.hosts
specified in the values and form a.toml
file for each host being a merge of the common.Values.conf
and a patch configuration for the provided host.I've managed to accomplish that by using
initContainers
for every host. The containers use themergeOverwrite
Helm function to merge values. And then using the simpletoToml
I echo the merged values into theemptyDir
mount I then mount into theapp
container.conf.toml
Helm generation on-the-fly based on the domain (#954) #1041 (comment) for details.So, given the following
values.yaml
file:(notice the
empty
domain having no patch,localhost
domain adding thelegal
part and theexample.com
overwriting the ports)We get the following files:
localhost.yaml
example.com.yaml
empty.yaml
Checklist
k::
labels applied