{{- if .Values.reloader.service }}
apiVersion: v1
kind: Service
metadata:
  annotations:
{{ include "reloader-helm3.annotations" . | indent 4 }}
{{- if .Values.reloader.service.annotations }}
{{ toYaml .Values.reloader.service.annotations | indent 4 }}
{{- end }}
  labels:
{{ include "reloader-labels.chart" . | indent 4 }}
{{- if .Values.reloader.service.labels }}
{{ toYaml .Values.reloader.service.labels | indent 4 }}
{{- end }}
  name: {{ template "reloader-fullname" . }}
  namespace: {{ .Values.namespace | default .Release.Namespace }}
spec:
  selector:
{{- if .Values.reloader.deployment.labels }}
{{ toYaml .Values.reloader.deployment.labels | indent 4 }}
{{- end }}
{{- if .Values.reloader.matchLabels }}
{{ toYaml .Values.reloader.matchLabels | indent 4 }}
{{- end }}
  ports:
  - port: {{ .Values.reloader.service.port }}
    name: http
    protocol: TCP
    targetPort: http
{{- end }}
