{{- if .Values.dashboard.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "traefik.fullname" . }}-dashboard
  labels:
    app: {{ template "traefik.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
  annotations:
  {{- if .Values.dashboard.service }}
  {{- range $key, $value := .Values.dashboard.service.annotations }}
    {{ $key }}: {{ $value | quote }}
  {{- end }}
  {{- end }}
spec:
  selector:
    app: {{ template "traefik.name" . }}
    release: {{ .Release.Name }}
  ports:
  - port: 80
    targetPort: 8080
{{- end }}
