{{- if and .Values.rbac.create .Values.clusterAgent.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: "{{ template "datadog.fullname" . }}"
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
  name: {{ template "datadog.clusterAgent.fullname" . }}
{{- end -}}
