{{ if .Values.global.prometheus.enabled }} {{- if .Values.prometheus.pushgateway.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: labels: {{- include "prometheus.pushgateway.labels" . | nindent 4 }} name: {{ template "prometheus.pushgateway.fullname" . }} namespace: {{ .Release.Namespace }} spec: selector: {{- if .Values.prometheus.pushgateway.schedulerName }} schedulerName: "{{ .Values.prometheus.pushgateway.schedulerName }}" {{- end }} matchLabels: {{- include "prometheus.pushgateway.matchLabels" . | nindent 6 }} replicas: {{ .Values.prometheus.pushgateway.replicaCount }} {{- if .Values.prometheus.pushgateway.strategy }} strategy: {{ toYaml .Values.prometheus.pushgateway.strategy | indent 4 }} {{- end }} template: metadata: {{- if .Values.prometheus.pushgateway.podAnnotations }} annotations: {{ toYaml .Values.prometheus.pushgateway.podAnnotations | indent 8 }} {{- end }} labels: {{- include "prometheus.pushgateway.labels" . | nindent 8 }} spec: serviceAccountName: {{ template "prometheus.serviceAccountName.pushgateway" . }} {{- if .Values.prometheus.pushgateway.priorityClassName }} priorityClassName: "{{ .Values.prometheus.pushgateway.priorityClassName }}" {{- end }} containers: - name: {{ template "prometheus.name" . }}-{{ .Values.prometheus.pushgateway.name }} image: "{{ .Values.prometheus.pushgateway.image.repository }}:{{ .Values.prometheus.pushgateway.image.tag }}" imagePullPolicy: "{{ .Values.prometheus.pushgateway.image.pullPolicy }}" args: {{- range $key, $value := .Values.prometheus.pushgateway.extraArgs }} - --{{ $key }}={{ $value }} {{- end }} ports: - containerPort: 9091 livenessProbe: httpGet: {{- if (index .Values.prometheus "pushgateway" "extraArgs" "web.route-prefix") }} path: /{{ index .Values.prometheus "pushgateway" "extraArgs" "web.route-prefix" }}/-/healthy {{- else }} path: /-/healthy {{- end }} port: 9091 initialDelaySeconds: 10 timeoutSeconds: 10 readinessProbe: httpGet: {{- if (index .Values.prometheus "pushgateway" "extraArgs" "web.route-prefix") }} path: /{{ index .Values.prometheus "pushgateway" "extraArgs" "web.route-prefix" }}/-/ready {{- else }} path: /-/ready {{- end }} port: 9091 initialDelaySeconds: 10 timeoutSeconds: 10 resources: {{ toYaml .Values.prometheus.pushgateway.resources | indent 12 }} {{- if .Values.prometheus.pushgateway.persistentVolume.enabled }} volumeMounts: - name: storage-volume mountPath: "{{ .Values.prometheus.pushgateway.persistentVolume.mountPath }}" subPath: "{{ .Values.prometheus.pushgateway.persistentVolume.subPath }}" {{- end }} {{- if .Values.prometheus.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.prometheus.imagePullSecrets | indent 2 }} {{- end }} {{- if .Values.prometheus.pushgateway.nodeSelector }} nodeSelector: {{ toYaml .Values.prometheus.pushgateway.nodeSelector | indent 8 }} {{- end }} {{- if .Values.prometheus.pushgateway.securityContext }} securityContext: {{ toYaml .Values.prometheus.pushgateway.securityContext | indent 8 }} {{- end }} {{- if .Values.prometheus.pushgateway.tolerations }} tolerations: {{ toYaml .Values.prometheus.pushgateway.tolerations | indent 8 }} {{- end }} {{- if .Values.prometheus.pushgateway.affinity }} affinity: {{ toYaml .Values.prometheus.pushgateway.affinity | indent 8 }} {{- end }} {{- if .Values.prometheus.pushgateway.persistentVolume.enabled }} volumes: - name: storage-volume persistentVolumeClaim: claimName: {{ if .Values.prometheus.pushgateway.persistentVolume.existingClaim }}{{ .Values.prometheus.pushgateway.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.pushgateway.fullname" . }}{{- end }} {{- end -}} {{- end }} {{ end }}