apiVersion: v1
kind: ServiceAccount
metadata:
  name: chaos-admin
  labels:
    name: chaos-admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: chaos-admin
  labels:
    name: chaos-admin
rules:
  - apiGroups: ["","apps","batch"]
    resources: ["jobs","deployments","daemonsets"]
    verbs: ["create","list","get","patch","delete"]
  - apiGroups: ["","litmuschaos.io"]
    resources: ["pods","configmaps","events","services","chaosengines","chaosexperiments","chaosresults","deployments","jobs"]
    verbs: ["get","create","update","patch","delete","list"] 
  - apiGroups: [""]
    resources: ["nodes"]
    verbs : ["get","list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: chaos-admin
  labels:
    name: chaos-admin
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: chaos-admin
subjects:
- kind: ServiceAccount
  name: chaos-admin
  namespace: default