apiVersion: v1
kind: Service
metadata:
  name: {{ template "prometheus-pushgateway.fullname" . }}
  annotations:
{{ .Values.serviceAnnotations | toYaml | indent 4 }}
  labels:
{{ template "prometheus-pushgateway.defaultLabels" merge (dict "extraLabels" .Values.serviceLabels) .  }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: {{ .Values.service.targetPort }}
      {{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
      nodePort: {{ .Values.service.nodePort }}
      {{- end }}
      protocol: TCP
      name: http
  selector:
    app: {{ template "prometheus-pushgateway.name" . }}
    release: {{ .Release.Name }}
