apiVersion: v1
kind: Service
metadata:
  name: nginx
  labels:
    {{- include "nginx.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
  {{- range .Values.service.ports }}
    - name: {{ .name }}
      port: {{ .port }}
      targetPort: {{ .targetPort }}
  {{- end }}
  selector:
    {{- include "nginx.selectorLabels" . | nindent 4 }}