apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "prometheus-pushgateway.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{ template "prometheus-pushgateway.defaultLabels" merge (dict "extraLabels" .Values.podLabels) . }} spec: replicas: {{ .Values.replicaCount }} {{- if .Values.strategy }} strategy: {{ toYaml .Values.strategy | indent 4 }} {{- end }} selector: matchLabels: app: {{ template "prometheus-pushgateway.name" . }} release: {{ .Release.Name }} template: metadata: labels: app: {{ template "prometheus-pushgateway.name" . }} release: {{ .Release.Name }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} spec: serviceAccountName: {{ template "prometheus-pushgateway.serviceAccountName" . }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName | quote }} {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} containers: - name: pushgateway image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.extraVars }} env: {{ toYaml .Values.extraVars | indent 12 }} {{- end }} {{- if .Values.extraArgs }} args: {{ toYaml .Values.extraArgs | indent 12 }} {{- end }} ports: - name: metrics containerPort: 9091 protocol: TCP {{- if .Values.liveness.enabled }} livenessProbe: {{ toYaml .Values.liveness.probe | indent 12 }} {{- end }} {{- if .Values.readiness.enabled }} readinessProbe: {{ toYaml .Values.readiness.probe | indent 12 }} {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} {{- if .Values.containerSecurityContext }} securityContext: {{ toYaml .Values.containerSecurityContext | indent 12 }} {{- end }} volumeMounts: - name: storage-volume mountPath: "{{ .Values.persistentVolume.mountPath }}" subPath: "{{ .Values.persistentVolume.subPath }}" {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumeMounts | indent 12 }} {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} {{- if .Values.affinity }} affinity: {{ toYaml .Values.affinity | indent 8 }} {{- end }} {{- if .Values.securityContext }} securityContext: {{ toYaml .Values.securityContext | indent 8 }} {{- end }} volumes: - name: storage-volume {{- if .Values.persistentVolume.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistentVolume.existingClaim }}{{ .Values.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus-pushgateway.fullname" . }}{{- end }} {{- else}} emptyDir: {} {{- end -}} {{- if .Values.extraVolumes }} {{ toYaml .Values.extraVolumes | indent 8 }} {{- end }}