{{- if .Values.clusterAgent.podSecurity.podSecurityPolicy.create }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: {{ template "datadog.fullname" . }}-cluster-agent
  labels:
{{ include "datadog.labels" . | indent 4 }}
spec:
  volumes:
    - configMap
    - hostPath
    - secret
  fsGroup:
    rule: RunAsAny
  runAsUser:
    rule: RunAsAny
  seLinux:
    rule: RunAsAny
  supplementalGroups:
    rule: RunAsAny
{{- end }}
