{{- if .Values.ui.enabled }} {{- $svcValues := .Values.ui.service }} apiVersion: v1 kind: Service metadata: name: {{ include "kafka.ui.fullname" . }} labels: {{- include "kafka.labels" . | nindent 4 }} {{- with $svcValues.labels }} {{- toYaml . | nindent 4 }} {{- end }} {{- with $svcValues.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if $svcValues.type }} type: {{ $svcValues.type | quote }} {{- end }} ports: - port: 8080 targetPort: http protocol: TCP name: http {{- if and $svcValues.nodePort (eq $svcValues.type "NodePort") }} nodePort: {{ $svcValues.nodePort }} {{- end }} selector: {{- include "kafka.selectorLabels" . | nindent 4 }} component: kafka-ui {{- end }}