{{- $root := . -}}
{{- range $name, $svc := .Values.services }}
{{- if $svc.port }}
---
apiVersion: v1
kind: Service
metadata:
  name: {{ $svc.image }}
  namespace: {{ $root.Release.Namespace }}
spec:
  selector:
    app: {{ $svc.image }}
  ports:
    - port: {{ $svc.port }}
      targetPort: {{ $svc.port }}
{{- end }}
{{- end }}
