{{ if .Values.global.prometheus.enabled }} {{- if .Values.prometheus.pushgateway.enabled -}} apiVersion: v1 kind: Service metadata: {{- if .Values.prometheus.pushgateway.service.annotations }} annotations: {{ toYaml .Values.prometheus.pushgateway.service.annotations | indent 4}} {{- end }} labels: {{- include "prometheus.pushgateway.labels" . | nindent 4 }} {{- if .Values.prometheus.pushgateway.service.labels }} {{ toYaml .Values.prometheus.pushgateway.service.labels | indent 4}} {{- end }} name: {{ template "prometheus.pushgateway.fullname" . }} namespace: {{ .Release.Namespace }} spec: {{- if .Values.prometheus.pushgateway.service.clusterIP }} clusterIP: {{ .Values.prometheus.pushgateway.service.clusterIP }} {{- end }} {{- if .Values.prometheus.pushgateway.service.externalIPs }} externalIPs: {{ toYaml .Values.prometheus.pushgateway.service.externalIPs | indent 4 }} {{- end }} {{- if .Values.prometheus.pushgateway.service.loadBalancerIP }} loadBalancerIP: {{ .Values.prometheus.pushgateway.service.loadBalancerIP }} {{- end }} {{- if .Values.prometheus.pushgateway.service.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{- range $cidr := .Values.prometheus.pushgateway.service.loadBalancerSourceRanges }} - {{ $cidr }} {{- end }} {{- end }} ports: - name: http port: {{ .Values.prometheus.pushgateway.service.servicePort }} protocol: TCP targetPort: 9091 selector: {{- include "prometheus.pushgateway.matchLabels" . | nindent 4 }} type: "{{ .Values.prometheus.pushgateway.service.type }}" {{- end }} {{ end }}