{{- if .Values.rbac.create }}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ include "scdf.fullname" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
rules:
  - apiGroups:
      - ""
    resources:
      - services
      - pods
      - replicationcontrollers
      - persistentvolumeclaims
    verbs:
      - get
      - list
      - watch
      - create
      - delete
      - update
  - apiGroups:
      - ""
    resources:
      - configmaps
      - secrets
      - pods/log
      - pods/status
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - apps
    resources:
      - statefulsets
      - deployments
      - replicasets
    verbs:
      - get
      - list
      - watch
      - create
      - delete
      - update
      - patch
  - apiGroups:
      - extensions
    resources:
      - deployments
      - replicasets
    verbs:
      - get
      - list
      - watch
      - create
      - delete
      - update
      - patch
  - apiGroups:
      - batch
    resources:
      - cronjobs
      - jobs
    verbs:
      - get
      - list
      - watch
      - create
      - delete
      - update
      - patch
{{- end }}
