---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: k8-pod-delete-sa
  namespace: default
  labels:
    name: k8-pod-delete-sa
    app.kubernetes.io/part-of: litmus
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: k8-pod-delete-sa
  namespace: default
  labels:
    name: k8-pod-delete-sa
    app.kubernetes.io/part-of: litmus
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: RoleBinding
metadata:
  name: k8-pod-delete-sa
  namespace: default
  labels:
    name: k8-pod-delete-sa
    app.kubernetes.io/part-of: litmus
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: k8-pod-delete-sa
subjects:
- kind: ServiceAccount
  name: k8-pod-delete-sa
  namespace: default

