[prometheus-postgres-exporter] Add support for `DATA_SOURCE_USER_FILE` environmental variable
ubajze opened this issue · 0 comments
Is your feature request related to a problem ?
We use Vault dynamic database secrets, where both username and password are dynamically generated. We then use a Vault injector to inject a username and password into a pod as a file. I see that Postgres exporter supports the variable DATA_SOURCE_USER_FILE
, where you specify the name of the file where the username is rendered. This is currently not supported in config:
helm-charts/charts/prometheus-postgres-exporter/values.yaml
Lines 126 to 155 in 62734a5
Describe the solution you'd like.
I want to specify the filename in a configuration. This is how the configuration should look like:
config:
datasource:
usernameFile: "/path/to/my/user/file"
The template would look similar to this:
helm-charts/charts/prometheus-postgres-exporter/templates/deployment.yaml
Lines 103 to 115 in 62734a5
{{- if .Values.config.datasource.usernameFile }}
- name: DATA_SOURCE_USER_FILE
value: {{ tpl .Values.config.datasource.usernameFile . }}
{{- else }}
- name: DATA_SOURCE_USER
valueFrom:
secretKeyRef:
{{- if .Values.config.datasource.usernameSecret }}
name: {{ tpl .Values.config.datasource.usernameSecret.name . }}
key: {{ tpl .Values.config.datasource.usernameSecret.key . }}
{{- else }}
name: {{ template "prometheus-postgres-exporter.fullname" . }}
key: data_source_password
Describe alternatives you've considered.
I can manually set the environmental variable:
extraEnvs:
- name: "DATA_SOURCE_USER_FILE"
value: "/path/to/my/user/file"
Additional context.
No response