1
+ ---
2
+ apiVersion : v1
3
+ kind : ServiceAccount
4
+ metadata :
5
+ name : litmus-admin
6
+ namespace : #{INFRA_NAMESPACE}
7
+ labels :
8
+ name : litmus-admin
9
+ ---
10
+ # Source: openebs/templates/clusterrole.yaml
11
+ apiVersion : rbac.authorization.k8s.io/v1
12
+ kind : ClusterRole
13
+ metadata :
14
+ name : litmus-admin
15
+ labels :
16
+ name : litmus-admin
17
+ rules :
18
+ # ***************************************************************************************
19
+ # Permissions needed for preparing and monitor the chaos resources by chaos-runner
20
+ # ***************************************************************************************
21
+
22
+ # The chaos operator watches the chaosengine resource and orchestrates the chaos experiment..
23
+ # # .. by creating the chaos-runner
24
+
25
+ # for creating and monitoring the chaos-runner pods
26
+ - apiGroups : [""]
27
+ resources : ["pods"]
28
+ verbs : ["create","delete","get","list","patch","update", "deletecollection"]
29
+ - apiGroups : [""]
30
+ resources : ["events"]
31
+ verbs : ["create","get","list","patch","update"]
32
+
33
+ # for fetching configmaps and secrets to inject into chaos-runner pod (if specified)
34
+ - apiGroups : [""]
35
+ resources : ["secrets", "configmaps"]
36
+ verbs : ["get", "list"]
37
+
38
+ # for tracking & getting logs of the pods created by chaos-runner to implement individual steps in the runner
39
+ - apiGroups : [""]
40
+ resources : ["pods/log"]
41
+ verbs : ["get", "list", "watch"]
42
+
43
+ # for configuring and monitor the experiment job by chaos-runner pod
44
+ - apiGroups : ["batch"]
45
+ resources : ["jobs"]
46
+ verbs : ["create", "list", "get", "delete", "deletecollection"]
47
+
48
+ # ********************************************************************
49
+ # Permissions needed for creation and discovery of chaos experiments
50
+ # ********************************************************************
51
+
52
+ # The helper pods are created by experiment to perform the actual chaos injection ...
53
+ # ... for a period of chaos duration
54
+
55
+ # for creating and managing to execute comands inside target container
56
+ - apiGroups : [""]
57
+ resources : ["pods/exec","pods/eviction","replicationcontrollers"]
58
+ verbs : ["get","list","create"]
59
+
60
+ # for tracking & getting logs of the pods created by experiment pod to implement individual steps in the experiment
61
+ - apiGroups : [""]
62
+ resources : ["pods/log"]
63
+ verbs : ["get", "list", "watch"]
64
+
65
+ # for creating and monitoring liveness services or monitoring target app services during chaos injection
66
+ - apiGroups : [""]
67
+ resources : ["services"]
68
+ verbs : ["create","get","list"]
69
+
70
+ # for checking the app parent resources as deployments or sts and are eligible chaos candidates
71
+ - apiGroups : ["apps"]
72
+ resources : ["deployments", "statefulsets"]
73
+ verbs : ["list", "get", "patch", "update"]
74
+
75
+ # for checking the app parent resources as replicasets and are eligible chaos candidates
76
+ - apiGroups : ["apps"]
77
+ resources : ["replicasets"]
78
+ verbs : ["list", "get"]
79
+
80
+ # for checking the app parent resources as deamonsets and are eligible chaos candidates
81
+ - apiGroups : ["apps"]
82
+ resources : ["daemonsets"]
83
+ verbs : ["list","get"]
84
+
85
+ # for checking (openshift) app parent resources if they are eligible chaos candidates
86
+ - apiGroups : ["apps.openshift.io"]
87
+ resources : ["deploymentconfigs"]
88
+ verbs : ["list", "get"]
89
+
90
+ # for checking (argo) app parent resources if they are eligible chaos candidates
91
+ - apiGroups : ["argoproj.io"]
92
+ resources : ["rollouts"]
93
+ verbs : ["list", "get"]
94
+
95
+ # performs CRUD operations on the network policies
96
+ - apiGroups : ["networking.k8s.io"]
97
+ resources : ["networkpolicies"]
98
+ verbs : ["create","delete","list","get"]
99
+
100
+ # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow
101
+ - apiGroups : ["litmuschaos.io"]
102
+ resources : ["chaosengines","chaosexperiments","chaosresults"]
103
+ verbs : ["create","list","get","patch","update","delete"]
104
+
105
+ # for experiment to perform node status checks and other node level operations like taint, drain in the experiment.
106
+ - apiGroups : [""]
107
+ resources : ["nodes"]
108
+ verbs : ["patch", "get", "list", "update"]
109
+ ---
110
+ apiVersion : rbac.authorization.k8s.io/v1
111
+ kind : ClusterRoleBinding
112
+ metadata :
113
+ name : litmus-admin
114
+ labels :
115
+ name : litmus-admin
116
+ roleRef :
117
+ apiGroup : rbac.authorization.k8s.io
118
+ kind : ClusterRole
119
+ name : litmus-admin
120
+ subjects :
121
+ - kind : ServiceAccount
122
+ name : litmus-admin
123
+ namespace : #{INFRA_NAMESPACE}
0 commit comments