Skip to content

Commit

Permalink
[kube-state-metrics] add option to add initContainers and additional …
Browse files Browse the repository at this point in the history
…sidecars (prometheus-community#3861)

Signed-off-by: Christian Schlotter <[email protected]>
  • Loading branch information
chrischdi authored and Matiasmct committed Mar 20, 2024
1 parent 79d8297 commit cee13cb
Show file tree
Hide file tree
Showing 3 changed files with 18 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.13.0
version: 5.14.0
appVersion: 2.10.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
7 changes: 7 additions & 0 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
{{- $httpPort := ternary 9090 (.Values.service.port | default 8080) .Values.kubeRBACProxy.enabled}}
{{- $telemetryPort := ternary 9091 (.Values.selfMonitor.telemetryPort | default 8081) .Values.kubeRBACProxy.enabled}}
Expand Down Expand Up @@ -240,6 +244,9 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.containers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if or .Values.imagePullSecrets .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- include "kube-state-metrics.imagePullSecrets" (dict "Values" .Values "imagePullSecrets" .Values.imagePullSecrets) | indent 8 }}
Expand Down
10 changes: 10 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,13 @@ extraManifests: []
# name: prometheus-extra
# data:
# extra-data: "value"

## Containers allows injecting additional containers.
containers: []
# - name: crd-init
# image: kiwigrid/k8s-sidecar:latest

## InitContainers allows injecting additional initContainers.
initContainers: []
# - name: crd-sidecar
# image: kiwigrid/k8s-sidecar:latest

0 comments on commit cee13cb

Please sign in to comment.