Skip to content

Commit 304a431

Browse files
authored
Merge pull request #55 from xhensiladoda/feat-envs-from-field-path
feat(chart): support env variables from fieldPath (feat for #54)
2 parents 4d90b38 + 789ab62 commit 304a431

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

chart/prometheus-mongodb-query-exporter/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ keywords:
1515
name: prometheus-mongodb-query-exporter
1616
sources:
1717
- https://github.com/raffis/mongodb-query-exporter
18-
version: 2.0.1
18+
version: 2.1.0

chart/prometheus-mongodb-query-exporter/templates/deployment.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ spec:
5353
- secretRef:
5454
name: {{ .Values.envFromSecret }}
5555
{{- end }}
56+
{{- range $key, $value := .Values.extraEnvFieldPath }}
57+
- name: {{ $key }}
58+
valueFrom:
59+
fieldRef:
60+
fieldPath: {{ $value }}
61+
{{- end }}
5662
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
5763
imagePullPolicy: {{ .Values.image.pullPolicy }}
5864
args:

chart/prometheus-mongodb-query-exporter/values.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ envFromSecret: ""
127127
## key: password
128128
extraEnvSecrets: {}
129129

130+
## A list of environment variables from fieldPath refs that will expose pod information to the container
131+
## This can be useful for enriching the custom metrics with pod information
132+
## example:
133+
## extraEnvFieldPath:
134+
## POD_NAME: metadata.name
135+
extraEnvFieldPath: {}
136+
130137
securityContext:
131138
allowPrivilegeEscalation: false
132139
capabilities:

0 commit comments

Comments
 (0)