{{- if and .Values.etcd.managed .Values.serviceAccounts.etcd.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ .Values.serviceAccounts.etcd.name | quote }}
  namespace: {{ .Release.Namespace }}
  {{- if .Values.serviceAccounts.etcd.annotations }}
  annotations:
{{ toYaml .Values.serviceAccounts.etcd.annotations | indent 4 }}
  {{- end }}
{{- end }}
