apiVersion: v1
kind: ServiceAccount
metadata:
  name: k8-aws-ec2-terminate-sa
  labels:
    name: k8-aws-ec2-terminate-sa
    app.kubernetes.io/part-of: litmus
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: k8-aws-ec2-terminate-sa
  labels:
    name: k8-aws-ec2-terminate-sa
    app.kubernetes.io/part-of: litmus
rules:
- apiGroups: ["","apps","batch","extensions","litmuschaos.io","openebs.io","storage.k8s.io"]
  resources: ["chaosengines","chaosexperiments","chaosresults","configmaps","cstorpools","cstorvolumereplicas","events","jobs","persistentvolumeclaims","persistentvolumes","pods","pods/exec","pods/log","secrets","storageclasses","chaosengines","chaosexperiments","chaosresults","configmaps","cstorpools","cstorvolumereplicas","daemonsets","deployments","events","jobs","persistentvolumeclaims","persistentvolumes","pods","pods/eviction","pods/exec","pods/log","replicasets","secrets","services","statefulsets","storageclasses"]
  verbs: ["create","delete","get","list","patch","update"]
- apiGroups: [""]
  resources: ["nodes"]
  verbs: ["get","list","patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: k8-aws-ec2-terminate-sa
  labels:
    name: k8-aws-ec2-terminate-sa
    app.kubernetes.io/part-of: litmus
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: k8-aws-ec2-terminate-sa
subjects:
- kind: ServiceAccount
  name: k8-aws-ec2-terminate-sa
  namespace: default
