-
Notifications
You must be signed in to change notification settings - Fork 7
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
docker entrypoint: can override conf with envvars #191
Conversation
Do I understand correctly, that you want to be able to store any Arango configuration option as environment variables? You can start any of the Arango binaries, e.g.
Is it really simpler to set up a bunch of environment variables instead of having a single configuration file? Also, what if you want to re-deploy to another machine? Copying the conf file seems much easier. Are you aware that you can use environment variables in configuration files? |
Yes, that's it.
That is why I used
An external config file means a volume. It works well on a dev's laptop, but with an orchestrated docker (whether it's Swarm or K8S), it is a bit more complicated.
Using env vars in the config files requires changing the config file. On top of that, my script's behaviour avoids maintenance, as it's compatible with any future ArangoDB config sections / parameters. |
It's ambiguous either way, wouldn't I guess it wouldn't hurt to have the option to configure everything through env vars, @dothebart ?
There is a small chance that it breaks, e.g. if the following two options existed: |
I'm bad at naming, but I don't see any technically problem with that.
You've just spotted a bug; the current code lets underscores as underscores. In order to work with current config options, it should take Apart from that, you're right in the way that, in future versions, if a section name contains a dash, it will be a problem. And I don't see an easy way to anticipate it. |
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.
LGTM.
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.
LGTM apart from typo in comment
@hervenicol I have one issue: how would we handle multiple
which translates to:
|
I did not think about that, I thought parameter names in a section would be unique. Right now, I don't see how to manage it. |
If you search https://www.arangodb.com/docs/stable/programs-arangod-options.html for the ellipsis symbol An example for that in action can be found here:
|
My thoughts on this one.
I tend to think the "less dirty" would be option 3. But not really proud of it. Let me know your opinion. |
maybe split the var value by |
CLA Available |
…D_CONF instead of ARANGOCONF
…ences of the same option
OK, I pushed a few updates. I did a simple version for multiple values that splits on newlines. Do you think it is good enough? I also changed the var prefix Waiting for your feedback. |
Replaced by #590. |
new feature:
you can override ArangoDB config with environment variables.
This to follow 12-factors principles: https://12factor.net/config
Here is the syntax:
Reasons for doing this:
All in all, I believe it's more logical / simple from a user point of view.