{{- range items -}}
# Code to execute for each item in the array
{{- end -}}
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
ports:
{{- range .Values.service.ports -}}
- port: {{ .port }}
targetPort: {{ .targetPort }}
{{- end }}
selector:
app: my-app