Skip to content

Commit

Permalink
Merge pull request #55 from xhensiladoda/feat-envs-from-field-path
Browse files Browse the repository at this point in the history
feat(chart): support env variables from fieldPath (feat for #54)
  • Loading branch information
raffis authored Apr 27, 2022
2 parents 4d90b38 + 789ab62 commit 304a431
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/prometheus-mongodb-query-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ keywords:
name: prometheus-mongodb-query-exporter
sources:
- https://github.com/raffis/mongodb-query-exporter
version: 2.0.1
version: 2.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ spec:
- secretRef:
name: {{ .Values.envFromSecret }}
{{- end }}
{{- range $key, $value := .Values.extraEnvFieldPath }}
- name: {{ $key }}
valueFrom:
fieldRef:
fieldPath: {{ $value }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
Expand Down
7 changes: 7 additions & 0 deletions chart/prometheus-mongodb-query-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ envFromSecret: ""
## key: password
extraEnvSecrets: {}

## A list of environment variables from fieldPath refs that will expose pod information to the container
## This can be useful for enriching the custom metrics with pod information
## example:
## extraEnvFieldPath:
## POD_NAME: metadata.name
extraEnvFieldPath: {}

securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down

0 comments on commit 304a431

Please sign in to comment.