# helm_charts_serviceaccounts.yaml
{{- $values := .Values }}
{{- range .Values.serviceAccounts }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ . }}
  {{- if hasKey $values "namespace" }}
  namespace: {{ $values.namespace }}
  {{- end }}
  labels:
    chart: {{ template "magic-namespace.chart" $ }}
    release: {{ $.Release.Name }}
    heritage: {{ $.Release.Service }}
{{- end }}