# helm_charts_service-accounts.yaml
{{- if .Values.serviceAccounts.controller.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "metallb.controllerServiceAccountName" . }}
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: {{ template "metallb.chart" . }}
    app: {{ template "metallb.name" . }}
{{- end }}
---
{{- if .Values.serviceAccounts.speaker.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "metallb.speakerServiceAccountName" . }}
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: {{ template "metallb.chart" . }}
    app: {{ template "metallb.name" . }}
{{- end }}