-
Notifications
You must be signed in to change notification settings - Fork 504
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
Automatic env var substitution in linkerd config files #1450
Comments
the way i've done this sort of thing in the past is passing in the config on stdin like:
where genconfig.sh has something like: #!/bin/sh
set -eu
cat <<EOF
interpreter:
kind: default
transformers:
– kind: io.l5d.specificHost
host: $LOCAL_IP
EOF |
If you see my blog post that is how I've done it except using envsubst. William tweeted saying it sounded like a reasonable request to have it built in natively. At the moment the only solution when needing env vars in your config is to derive from the official container and do some config manipulation yourself which is a bit cumbersome. |
Thanks for submitting this @kevholditch! |
Support automatic replacement of environment variables in the linkerd.conf file when linkerd starts up.
This is useful in a number of scenarios when parts of the config are not known until runtime especially when running in a docker container (see my blog post for a real world scenario).
The format of the variable in the config file could be prefixed with a '$' for example:
Here $LOCAL_IP would be replaced with the value found at runtime in the environment variable LOCAL_IP.
The text was updated successfully, but these errors were encountered: