{{- if and .Values.Secure.Enabled .Values.Secure.ServiceAccount.Create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "cockroachdb.serviceAccountName" . }}
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    component: "{{ .Release.Name }}-{{ .Values.Component }}"
{{- end }}