Conditionally include the KSM and PG containers in the Prometheus deployment
@@ -38,6 +38,7 @@ spec:
spec:
serviceAccountName: {{ .Release.Name }}-server
containers:
+ {{- if .Values.promServer.scrapes.kubeStateMetrics }}
- name: kube-state-metrics
args:
- --collectors=pods
@@ -59,6 +60,8 @@ spec:
timeoutSeconds: 5
resources:
{{- toYaml .Values.kubeStateMetrics.resources | nindent 10 }}
+ {{- end }}
+ {{- if .Values.promServer.scrapes.pushGateway }}
- name: prometheus-pushgateway
image: "{{ .Values.pushGateway.image.repository }}:{{ .Values.pushGateway.image.tag }}"
imagePullPolicy: {{ .Values.pushGateway.image.pullPolicy }}
@@ -79,6 +82,7 @@ spec:
timeoutSeconds: 10
resources:
{{- toYaml .Values.pushGateway.resources | nindent 10 }}
+ {{- end }}
- name: prometheus-server
image: "{{ .Values.promServer.image.repository }}:{{ .Values.promServer.image.tag }}"
imagePullPolicy: {{ .Values.promServer.image.pullPolicy }}
