apiVersion: v1
kind: Service
metadata:
  labels:
    app: {{ template "kuberhealthy.name" . }}
    release: {{ .Release.Name }}
  name: {{ template "kuberhealthy.name" . }}
  {{- if .Values.service.annotations }}
  annotations:
  {{- range $key, $value := .Values.service.annotations }}
    {{ $key }}: {{ $value | quote }}
  {{- end }}
  {{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
  - port: {{ .Values.service.externalPort }}
    name: http
    targetPort: http
  selector:
    app: {{ template "kuberhealthy.name" . }}
    release: {{ .Release.Name }}
