apiVersion: v1 kind: Service metadata: name: {{ include "mailproxy.fullname" . }}-mailauth labels: {{- include "mailproxy.labels" . | nindent 4 }} spec: type: {{ .Values.mailauth.service.type }} ports: {{- range $i, $port := .Values.mailauth.service.ports }} - port: {{ $port.number }} targetPort: {{ $port.number }} protocol: {{ $port.protocol }} name: {{ $port.name }} {{- end }} selector: {{- include "mailproxy.mailauth.selectorLabels" . | nindent 4 }}