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

Support resolving environment variables in configuration #2533

Conversation

julienduchesne
Copy link
Contributor

@julienduchesne julienduchesne commented Apr 1, 2021

Super simple solution. Mostly opening this to get some feedback. Is such a solution good enough to ever be accepted?

Based on Kubernetes' resolution for container args: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#use-environment-variables-to-define-arguments
The expansion code is directly taken from there: https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/pkg/kubelet/container/helpers.go#L163

Probably fixes #2498 partially

Super simple solution. I want to get some input on it
Based on Kubernetes' resolution for container args: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#use-environment-variables-to-define-arguments

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
@julienduchesne julienduchesne force-pushed the support-env-variables-in-config branch from e5a145b to 0dea6a9 Compare April 1, 2021 18:51
@roidelapluie
Copy link
Member

This is different than #2498. Expanding env variable is something that was considered in the past and not accepted.

Can I know what is your usecase?

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
@julienduchesne julienduchesne force-pushed the support-env-variables-in-config branch from 09efb30 to 7426cf1 Compare April 1, 2021 18:54
@julienduchesne
Copy link
Contributor Author

julienduchesne commented Apr 1, 2021

This is different than #2498. Expanding env variable is something that was considered in the past and not accepted.

Can I know what is your usecase?

Injecting Kubernetes secrets as environment variables to be used in alertmanager configurations

@julienduchesne julienduchesne changed the title Suport resolving environment variables in configuration Support resolving environment variables in configuration Apr 1, 2021
@roidelapluie
Copy link
Member

#2498 is about having secrets as files that can be read by alertmanager. Based on previous votes and even the last public prometheus developers summit, we are not allowing environment variable substitutions from the complete file.

I will add more details to #2498.

@julienduchesne
Copy link
Contributor Author

Alright, I did find the previous issues about it (should've looked better 😄 ). Thanks for answering

@julienduchesne julienduchesne deleted the support-env-variables-in-config branch April 2, 2021 01:59
@julienduchesne julienduchesne restored the support-env-variables-in-config branch April 2, 2021 01:59
@julienduchesne julienduchesne deleted the support-env-variables-in-config branch April 2, 2021 01:59
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.

Generally enable reading secrets from files
2 participants