@@ -21,25 +21,309 @@ For more detailed information see [Upgrade Support](../concepts/upgrade-support.
2121
2222## Procedure
2323
24- Suppose we have successfully created and installed v0.2.0 of the ArgoCD operator with the following ` ClusterExtension ` :
25-
26- ``` yaml title="Example CR"
27- apiVersion : olm.operatorframework.io/v1
28- kind : ClusterExtension
29- metadata :
30- name : argocd
31- spec :
32- namespace : argocd
33- serviceAccount :
34- name : argocd-installer
35- source :
36- sourceType : Catalog
37- catalog :
38- packageName : argocd-operator
39- version : 0.2.0
24+ For this example, we will be using v0.2.0 of the ArgoCD operator. If you would like to follow along
25+ with this tutorial, you can apply the following manifest to your cluster by, for example,
26+ saving it to a local file and then running ` kubectl apply -f FILENAME ` :
27+
28+ ??? example "ArgoCD v0.2.0 manifests"
29+ ```yaml
30+ ---
31+ apiVersion: v1
32+ kind: Namespace
33+ metadata:
34+ name: argocd
35+ ---
36+ apiVersion: v1
37+ kind: ServiceAccount
38+ metadata:
39+ name: argocd-installer
40+ namespace: argocd
41+ ---
42+ apiVersion: rbac.authorization.k8s.io/v1
43+ kind: ClusterRoleBinding
44+ metadata:
45+ name: argocd-installer-binding
46+ roleRef:
47+ apiGroup: rbac.authorization.k8s.io
48+ kind: ClusterRole
49+ name: argocd-installer-clusterrole
50+ subjects:
51+ - kind: ServiceAccount
52+ name: argocd-installer
53+ namespace: argocd
54+ ---
55+ apiVersion: rbac.authorization.k8s.io/v1
56+ kind: ClusterRole
57+ metadata:
58+ name: argocd-installer-clusterrole
59+ rules:
60+ # Allow ClusterExtension to set blockOwnerDeletion ownerReferences
61+ - apiGroups: [ olm.operatorframework.io]
62+ resources: [ clusterextensions/finalizers]
63+ verbs: [ update]
64+ resourceNames: [ argocd]
65+ # Manage ArgoCD CRDs
66+ - apiGroups: [ apiextensions.k8s.io]
67+ resources: [ customresourcedefinitions]
68+ verbs: [ create, list, watch]
69+ - apiGroups: [ apiextensions.k8s.io]
70+ resources: [ customresourcedefinitions]
71+ verbs: [ get, update, patch, delete]
72+ resourceNames:
73+ - appprojects.argoproj.io
74+ - argocds.argoproj.io
75+ - applications.argoproj.io
76+ - argocdexports.argoproj.io
77+ - applicationsets.argoproj.io
78+ # Manage ArgoCD ClusterRoles and ClusterRoleBindings
79+ - apiGroups: [ rbac.authorization.k8s.io]
80+ resources: [ clusterroles]
81+ verbs: [ create, list, watch]
82+ - apiGroups: [ rbac.authorization.k8s.io]
83+ resources: [ clusterroles]
84+ verbs: [ get, update, patch, delete]
85+ resourceNames:
86+ - argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
87+ - argocd-operator-metrics-reader
88+ - argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
89+ - apiGroups: [ rbac.authorization.k8s.io]
90+ resources: [ clusterrolebindings]
91+ verbs: [ create, list, watch]
92+ - apiGroups: [ rbac.authorization.k8s.io]
93+ resources: [ clusterrolebindings]
94+ verbs: [ get, update, patch, delete]
95+ resourceNames:
96+ - argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
97+ - argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
98+ ---
99+ apiVersion: rbac.authorization.k8s.io/v1
100+ kind: ClusterRoleBinding
101+ metadata:
102+ name: argocd-installer-rbac-binding
103+ roleRef:
104+ apiGroup: rbac.authorization.k8s.io
105+ kind: ClusterRole
106+ name: argocd-installer-rbac-clusterrole
107+ subjects:
108+ - kind: ServiceAccount
109+ name: argocd-installer
110+ namespace: argocd
111+ ---
112+ apiVersion: rbac.authorization.k8s.io/v1
113+ kind: ClusterRole
114+ metadata:
115+ name: argocd-installer-rbac-clusterrole
116+ rules:
117+ - apiGroups: [ ""]
118+ resources: [ configmaps]
119+ verbs: [ '* ']
120+ - apiGroups: [ ""]
121+ resources: [ endpoints]
122+ verbs: [ '* ']
123+ - apiGroups: [ ""]
124+ resources: [ events]
125+ verbs: [ '* ']
126+ - apiGroups: [ ""]
127+ resources: [ namespaces]
128+ verbs: [ '* ']
129+ - apiGroups: [ ""]
130+ resources: [ persistentvolumeclaims]
131+ verbs: [ '* ']
132+ - apiGroups: [ ""]
133+ resources: [ pods]
134+ verbs: [ '* ', get]
135+ - apiGroups: [ ""]
136+ resources: [ pods/log]
137+ verbs: [ get]
138+ - apiGroups: [ ""]
139+ resources: [ secrets]
140+ verbs: [ '* ']
141+ - apiGroups: [ ""]
142+ resources: [ serviceaccounts]
143+ verbs: [ '* ']
144+ - apiGroups: [ ""]
145+ resources: [ services]
146+ verbs: [ '* ']
147+ - apiGroups: [ ""]
148+ resources: [ services/finalizers]
149+ verbs: [ '* ']
150+ - apiGroups: [ apps]
151+ resources: [ daemonsets]
152+ verbs: [ '* ']
153+ - apiGroups: [ apps]
154+ resources: [ deployments]
155+ verbs: [ '* ']
156+ - apiGroups: [ apps]
157+ resources: [ deployments/finalizers]
158+ resourceNames: [ argocd-operator]
159+ verbs: [ update]
160+ - apiGroups: [ apps]
161+ resources: [ replicasets]
162+ verbs: [ '* ']
163+ - apiGroups: [ apps]
164+ resources: [ statefulsets]
165+ verbs: [ '* ']
166+ - apiGroups: [ apps.openshift.io]
167+ resources: [ deploymentconfigs]
168+ verbs: [ '* ']
169+ - apiGroups: [ argoproj.io]
170+ resources: [ applications]
171+ verbs: [ '* ']
172+ - apiGroups: [ argoproj.io]
173+ resources: [ appprojects]
174+ verbs: [ '* ']
175+ - apiGroups: [ argoproj.io]
176+ resources: [ argocdexports]
177+ verbs: [ '* ']
178+ - apiGroups: [ argoproj.io]
179+ resources: [ argocdexports/finalizers]
180+ verbs: [ '* ']
181+ - apiGroups: [ argoproj.io]
182+ resources: [ argocdexports/status]
183+ verbs: [ '* ']
184+ - apiGroups: [ argoproj.io]
185+ resources: [ argocds]
186+ verbs: [ '* ']
187+ - apiGroups: [ argoproj.io]
188+ resources: [ argocds/finalizers]
189+ verbs: [ '* ']
190+ - apiGroups: [ argoproj.io]
191+ resources: [ argocds/status]
192+ verbs: [ '* ']
193+ - apiGroups: [ authentication.k8s.io]
194+ resources: [ tokenreviews]
195+ verbs: [ create]
196+ - apiGroups: [ authorization.k8s.io]
197+ resources: [ subjectaccessreviews]
198+ verbs: [ create]
199+ - apiGroups: [ autoscaling]
200+ resources: [ horizontalpodautoscalers]
201+ verbs: [ '* ']
202+ - apiGroups: [ batch]
203+ resources: [ cronjobs]
204+ verbs: [ '* ']
205+ - apiGroups: [ batch]
206+ resources: [ jobs]
207+ verbs: [ '* ']
208+ - apiGroups: [ config.openshift.io]
209+ resources: [ clusterversions]
210+ verbs: [ get, list, watch]
211+ - apiGroups: [ monitoring.coreos.com]
212+ resources: [ prometheuses]
213+ verbs: [ '* ']
214+ - apiGroups: [ monitoring.coreos.com]
215+ resources: [ servicemonitors]
216+ verbs: [ '* ']
217+ - apiGroups: [ networking.k8s.io]
218+ resources: [ ingresses]
219+ verbs: [ '* ']
220+ - apiGroups: [ oauth.openshift.io]
221+ resources: [ oauthclients]
222+ verbs: [ create, delete, get, list, patch, update, watch]
223+ - apiGroups: [ rbac.authorization.k8s.io]
224+ resources: [ '* ']
225+ verbs: [ '* ']
226+ - apiGroups: [ rbac.authorization.k8s.io]
227+ resources: [ clusterrolebindings]
228+ verbs: [ '* ']
229+ - apiGroups: [ rbac.authorization.k8s.io]
230+ resources: [ clusterroles]
231+ verbs: [ '* ']
232+ - apiGroups: [ route.openshift.io]
233+ resources: [ routes]
234+ verbs: [ '* ']
235+ - apiGroups: [ route.openshift.io]
236+ resources: [ routes/custom-host]
237+ verbs: [ '* ']
238+ - apiGroups: [ template.openshift.io]
239+ resources: [ templateconfigs]
240+ verbs: [ '* ']
241+ - apiGroups: [ template.openshift.io]
242+ resources: [ templateinstances]
243+ verbs: [ '* ']
244+ - apiGroups: [ template.openshift.io]
245+ resources: [ templates]
246+ verbs: [ '* ']
247+ ---
248+ apiVersion: rbac.authorization.k8s.io/v1
249+ kind: Role
250+ metadata:
251+ name: argocd-installer-role
252+ namespace: argocd
253+ rules:
254+ - apiGroups: [ ""]
255+ resources: [ serviceaccounts]
256+ verbs: [ create, list, watch]
257+ - apiGroups: [ ""]
258+ resources: [ serviceaccounts]
259+ verbs: [ get, update, patch, delete]
260+ resourceNames: [ argocd-operator-controller-manager]
261+ - apiGroups: [ ""]
262+ resources: [ configmaps]
263+ verbs: [ create, list, watch]
264+ - apiGroups: [ ""]
265+ resources: [ configmaps]
266+ verbs: [ get, update, patch, delete]
267+ resourceNames: [ argocd-operator-manager-config]
268+ - apiGroups: [ ""]
269+ resources: [ services]
270+ verbs: [ create, list, watch]
271+ - apiGroups: [ ""]
272+ resources: [ services]
273+ verbs: [ get, update, patch, delete]
274+ resourceNames: [ argocd-operator-controller-manager-metrics-service]
275+ - apiGroups: [ apps]
276+ resources: [ deployments]
277+ verbs: [ create, list, watch]
278+ - apiGroups: [ apps]
279+ resources: [ deployments]
280+ verbs: [ get, update, patch, delete]
281+ resourceNames: [ argocd-operator-controller-manager]
282+ ---
283+ apiVersion: rbac.authorization.k8s.io/v1
284+ kind: RoleBinding
285+ metadata:
286+ name: argocd-installer-binding
287+ namespace: argocd
288+ roleRef:
289+ apiGroup: rbac.authorization.k8s.io
290+ kind: Role
291+ name: argocd-installer-role
292+ subjects:
293+ - kind: ServiceAccount
294+ name: argocd-installer
295+ namespace: argocd
296+ ---
297+ apiVersion: olm.operatorframework.io/v1
298+ kind: ClusterExtension
299+ metadata:
300+ name: argocd
301+ spec:
302+ namespace: argocd
303+ serviceAccount:
304+ name: argocd-installer
305+ source:
306+ sourceType: Catalog
307+ catalog:
308+ packageName: argocd-operator
309+ version: 0.2.0
310+ ```
311+
312+ If we view the current state of our ClusterExtension we should see that we have installed version 0.2.0:
313+
314+ ``` terminal
315+ kubectl get clusterextension argocd -o yaml | tail -n4
40316```
41317
42- * Update the version field in the ClusterExtension resource:
318+ !!! success "Command output"
319+ ``` yaml
320+ install:
321+ bundle:
322+ name: argocd-operator.v0.2.0
323+ version: 0.2.0
324+ ```
325+
326+ * To initiate our upgrade, let's update the version field in the ClusterExtension resource:
43327
44328 ``` terminal
45329 kubectl apply -f - <<EOF
59343 EOF
60344 ```
61345
62- !!! success
63- ` ` ` text title="Example output"
346+ !!! success "Command output"
347+ ``` text
64348 clusterextension.olm.operatorframework.io/argocd configured
65349 ```
66350
70354 kubectl patch clusterextension argocd --type='merge' -p '{"spec": {"source": {"catalog": {"version": "0.2.1"}}}}'
71355 ```
72356
73- !!! success
74- ` ` ` text title="Example output"
357+ !!! success "Command output"
358+ ``` text
75359 clusterextension.olm.operatorframework.io/argocd patched
76360 ```
77361
81365 kubectl get clusterextension argocd -o yaml
82366 ```
83367
84- ??? success
85- ` ` ` text title="Example output"
368+ ??? success "Updated ClusterExtension status"
369+ ``` text
86370 apiVersion: olm.operatorframework.io/v1
87371 kind: ClusterExtension
88372 metadata:
@@ -151,3 +435,9 @@ spec:
151435 name: argocd-operator.v0.2.1
152436 version: 0.2.1
153437 ```
438+
439+ !!! note "Note on `last-applied-configuration`"
440+ After your upgrade, the contents of the `kubectl.kubernetes.io/last-applied-configuration` annotation field will
441+ differ depending on your method of upgrade. If you apply a new ClusterExtension manifest as in the first method shown,
442+ the last applied configuration will show the new version since we replaced the existing manifest. If you use the patch
443+ method or `kubectl edit clusterextension`, then the last applied configuration will show the old version.
0 commit comments