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