feat: Add support for fetching config from env#1333
feat: Add support for fetching config from env#1333abhisek wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
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 <abhisek.datta@gmail.com>
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.
|
bernot-dev
left a comment
There was a problem hiding this comment.
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.
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.
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