Skip to content

Commit

Permalink
[kube-state-metrics] add additional environment variables support.
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Liang <[email protected]>
  • Loading branch information
liangyuanpeng committed Dec 27, 2024
1 parent eb7ab52 commit 3e4a51a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 5.27.1
version: 5.28.0
appVersion: 2.14.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
11 changes: 11 additions & 0 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }}
{{- end }}

{{ else }}
{{- if .Values.env }}
env:
{{- toYaml .Values.env | nindent 8 }}
{{- end }}

{{- end }}

args:
{{- if .Values.extraArgs }}
{{- .Values.extraArgs | toYaml | nindent 8 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ serviceAccount:
# If false then the user will opt out of automounting API credentials.
automountServiceAccountToken: true

# Additional Environment variables
env: {}
# - name: GOMAXPROCS
# valueFrom:
# resourceFieldRef:
# resource: limits.cpu

prometheus:
monitor:
enabled: false
Expand Down

0 comments on commit 3e4a51a

Please sign in to comment.