Skip to content

Commit

Permalink
[kube-state-metrics] Allow adding volumeMounts and volumes in deploym…
Browse files Browse the repository at this point in the history
…ent (#2296)

* [kube-state-metrics] Allow adding volumeMounts and volumes in deployment

Signed-off-by: Gadi Sneh gadisn@gmail.com

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* Add deployment template changes

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* Bump chart version

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* Bump minor instead of patch

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* CR fix - indentation for 'end'

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* CR fix - typo in 'beloe'

Signed-off-by: gadisn <gadisn@users.noreply.github.com>

* Bump version again to 4.15.0

Signed-off-by: gadisn <gadisn@users.noreply.github.com>
  • Loading branch information
gadisn committed Aug 2, 2022
1 parent 6d7102e commit b48194c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 4.14.0
version: 4.15.0
appVersion: 2.5.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
14 changes: 12 additions & 2 deletions charts/kube-state-metrics/templates/deployment.yaml
Expand Up @@ -93,12 +93,17 @@ spec:
- --telemetry-host={{ .Values.selfMonitor.telemetryHost }}
{{- end }}
- --telemetry-port={{ .Values.selfMonitor.telemetryPort | default 8081 }}
{{- if .Values.kubeconfig.enabled }}
{{- if or (.Values.kubeconfig.enabled) (.Values.volumeMounts) }}
volumeMounts:
{{- if .Values.kubeconfig.enabled }}
- name: kubeconfig
mountPath: /opt/k8s/.kube/
readOnly: true
{{- end }}
{{- if .Values.volumeMounts }}
{{ toYaml .Values.volumeMounts | indent 8 }}
{{- end }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
Expand Down Expand Up @@ -148,9 +153,14 @@ spec:
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.kubeconfig.enabled}}
{{- if or (.Values.kubeconfig.enabled) (.Values.volumes) }}
volumes:
{{- if .Values.kubeconfig.enabled}}
- name: kubeconfig
secret:
secretName: {{ template "kube-state-metrics.fullname" . }}-kubeconfig
{{- end }}
{{- if .Values.volumes }}
{{ toYaml .Values.volumes | indent 8 }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/kube-state-metrics/values.yaml
Expand Up @@ -249,3 +249,16 @@ selfMonitor:
# telemetryHost: 0.0.0.0
# telemetryPort: 8081
# telemetryNodePort: 0

# volumeMounts are used to add custom volume mounts to deployment.
# See example below
volumeMounts: []
# - mountPath: /etc/config
# name: config-volume

# volumes are used to add custom volumes to deployment
# See example below
volumes: []
# - configMap:
# name: cm-for-volume
# name: config-volume

0 comments on commit b48194c

Please sign in to comment.