Skip to content

Commit e56a22d

Browse files
authored
Update updater roles necessary for non-operator based viziers (#1578)
Summary: The role refactors in ff26221 and then later 87b7751 caused us to drop some ClusterRoles that the updater relied on to upgrade viziers that don't have an operator. I believe the initial breakage was caused by ff26221 since it no longer included the necessary clusterrole, however it referenced an old clusterrole which meant that upgrades worked on clusters that had the old role. 87b7751 then removed the binding to the old seemingly non-existent clusterrole while then broke upgrades further. This attempts to add back the necessary permissions to unbreak such deploys. Note that even with this change, I believe anyone running a non-operator deploy of vizier that was first deployed after v0.12.6 won't be able to auto-upgrade to any newer versions unless they manually patch the roles and clusterroles for the updater service account. Type of change: /kind bug Test Plan: Deployed a vizier on a freshly created cluster. Removed any traces of the CRD, olm, operator. Updated the roles and clusterroles by patching in this change on the cluster. Used the `px` CLI to upgrade said vizier to an RC, ensured that the non-operator Job based upgrade triggered and succeeded. Changelog Message: ```release-note This release adds additional ClusterRoles and Roles that the `vizier-upgrade-job` needs to upgrade Viziers deployed without an operator. ``` Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>
1 parent aa57680 commit e56a22d

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

k8s/vizier/bootstrap/updater_role.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ rules:
1717
- pods
1818
- services
1919
- persistentvolumes
20+
- persistentvolumeclaims
2021
- serviceaccounts
2122
verbs:
2223
- create
@@ -26,6 +27,15 @@ rules:
2627
- patch
2728
- update
2829
- watch
30+
- apiGroups:
31+
- ""
32+
resources:
33+
- events
34+
- pods/log
35+
verbs:
36+
- get
37+
- watch
38+
- list
2939
- apiGroups:
3040
- apps
3141
resources:
@@ -53,6 +63,42 @@ rules:
5363
- patch
5464
- update
5565
- watch
66+
- apiGroups:
67+
- coordination.k8s.io
68+
resources:
69+
- leases
70+
resourceNames:
71+
- cloud-conn-election
72+
- metadata-election
73+
verbs:
74+
- get
75+
- update
76+
- apiGroups:
77+
- coordination.k8s.io
78+
resources:
79+
- leases
80+
verbs:
81+
- create
82+
- apiGroups:
83+
- px.dev
84+
resources:
85+
- viziers
86+
verbs:
87+
- create
88+
- delete
89+
- get
90+
- list
91+
- patch
92+
- update
93+
- watch
94+
- apiGroups:
95+
- px.dev
96+
resources:
97+
- viziers/status
98+
verbs:
99+
- get
100+
- list
101+
- watch
56102
- apiGroups:
57103
- rbac.authorization.k8s.io
58104
resources:
@@ -79,3 +125,64 @@ subjects:
79125
- kind: ServiceAccount
80126
name: pl-updater-service-account
81127
namespace: pl
128+
---
129+
apiVersion: rbac.authorization.k8s.io/v1
130+
kind: ClusterRole
131+
metadata:
132+
name: pl-updater-cluster-role
133+
rules:
134+
- apiGroups:
135+
- rbac.authorization.k8s.io
136+
resources:
137+
- clusterroles
138+
- clusterrolebindings
139+
verbs:
140+
- create
141+
- delete
142+
- get
143+
- list
144+
- patch
145+
- update
146+
- watch
147+
- apiGroups:
148+
- ""
149+
resources:
150+
- namespaces
151+
verbs:
152+
- get
153+
resourceNames:
154+
- kube-system
155+
- apiGroups:
156+
- ""
157+
resources:
158+
- nodes
159+
- pods
160+
- services
161+
- endpoints
162+
- namespaces
163+
verbs:
164+
- get
165+
- watch
166+
- list
167+
- apiGroups:
168+
- apps
169+
resources:
170+
- replicasets
171+
- deployments
172+
verbs:
173+
- get
174+
- watch
175+
- list
176+
---
177+
apiVersion: rbac.authorization.k8s.io/v1
178+
kind: ClusterRoleBinding
179+
metadata:
180+
name: pl-updater-cluster-binding
181+
roleRef:
182+
apiGroup: rbac.authorization.k8s.io
183+
kind: ClusterRole
184+
name: pl-updater-cluster-role
185+
subjects:
186+
- kind: ServiceAccount
187+
name: pl-updater-service-account
188+
namespace: pl

0 commit comments

Comments
 (0)