{{- if and .Values.dashboard.enable .Values.dashboard.service -}} apiVersion: v1 kind: Service metadata: name: {{ include "polaris.fullname" . }}-dashboard {{- if .Values.templateOnly }} namespace: {{ .Release.Namespace }} {{- end }} labels: {{- include "polaris.labels" . | nindent 4 }} annotations: {{- range $key, $value := .Values.dashboard.service.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} spec: ports: - name: http-dashboard port: 80 protocol: TCP targetPort: {{ .Values.dashboard.service.targetPort | default .Values.dashboard.port }} selector: {{- include "polaris.selectors" . | nindent 4 }} component: dashboard type: {{ .Values.dashboard.service.type }} {{- if .Values.dashboard.service.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{ toYaml .Values.dashboard.service.loadBalancerSourceRanges | nindent 4 }} {{- end }} {{- end -}}