-
Notifications
You must be signed in to change notification settings - Fork 95
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: Add support for fetching config from env #1333
base: main
Are you sure you want to change the base?
feat: Add support for fetching config from env #1333
Conversation
This seems like a reasonable feature to support. I'm not sure we would just want to support providing just a subset of the flags though. Any particular rationale for those three? Also, the commit message lister will require a lowercase "A". Thanks for the PR! |
Signed-off-by: abhisek <[email protected]>
7df32e2
to
ac8a547
Compare
Thanks. This will help us setup the
Specifically for our use, the CA/Key file flags are not required from environment because we can make them available as volume mounts with any file path. A k8s secret is mounted as a file and the file name is a local concern (i.e. within the job yaml) hence the actual path does not matter and can hardcoded as a command line argument. However I have added env fallback for
Fixed.
|
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.
Just a couple small issues around naming to resolve. Thank you!
variables: | ||
|
||
- `DATASOURCE_UIDS` | ||
- `GRAFANA_SERVICE_ACCOUNT_TOKEN` |
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.
The corresponding flag is named grafana-api-token
. The env variable name should be GRAFANA_API_TOKEN
, for consistency.
- `PROJECT_ID` | ||
- `TLS_CERT_FILE` | ||
- `TLS_KEY_FILE` | ||
- `TLS_CA_FILE` |
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.
Likewise, I think naming the TLS environment variables consistently with the flags would be preferred.
I am following the official documentation to setup Grafana with datasource-syncer for Managed Prometheus:
https://cloud.google.com/stackdriver/docs/managed-prometheus/query#use-kubernetes
Our standard approach for providing config & secrets are through environment. Adding environment as a fallback source for config when not provided through command line