Skip to content

Commit c0dcefa

Browse files
committed
Add example manifest for ArgoCD v0.2.0
For our examples to work, we need to use a very specific version of our example operator. The upgrade from 0.2.0 to 0.2.1 functions properly for our purposes, but we don't want to affect the sample operator in config/samples so we are adding the example manifest for 0.2.0 directly to this tutorial. Signed-off-by: Tayler Geiger <[email protected]>
1 parent f70dafd commit c0dcefa

File tree

1 file changed

+304
-23
lines changed

1 file changed

+304
-23
lines changed

docs/tutorials/upgrade-extension.md

Lines changed: 304 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,300 @@ 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: [rbac.authorization.k8s.io]
221+
resources: ['*']
222+
verbs: ['*']
223+
- apiGroups: [rbac.authorization.k8s.io]
224+
resources: [clusterrolebindings]
225+
verbs: ['*']
226+
- apiGroups: [rbac.authorization.k8s.io]
227+
resources: [clusterroles]
228+
verbs: ['*']
229+
- apiGroups: [route.openshift.io]
230+
resources: [routes]
231+
verbs: ['*']
232+
- apiGroups: [route.openshift.io]
233+
resources: [routes/custom-host]
234+
verbs: ['*']
235+
- apiGroups: ["coordination.k8s.io"]
236+
resources: ["leases"]
237+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
238+
---
239+
apiVersion: rbac.authorization.k8s.io/v1
240+
kind: Role
241+
metadata:
242+
name: argocd-installer-role
243+
namespace: argocd
244+
rules:
245+
- apiGroups: [""]
246+
resources: [serviceaccounts]
247+
verbs: [create, list, watch]
248+
- apiGroups: [""]
249+
resources: [serviceaccounts]
250+
verbs: [get, update, patch, delete]
251+
resourceNames: [argocd-operator-controller-manager]
252+
- apiGroups: [""]
253+
resources: [configmaps]
254+
verbs: [create, list, watch]
255+
- apiGroups: [""]
256+
resources: [configmaps]
257+
verbs: [get, update, patch, delete]
258+
resourceNames: [argocd-operator-manager-config]
259+
- apiGroups: [""]
260+
resources: [services]
261+
verbs: [create, list, watch]
262+
- apiGroups: [""]
263+
resources: [services]
264+
verbs: [get, update, patch, delete]
265+
resourceNames: [argocd-operator-controller-manager-metrics-service]
266+
- apiGroups: [apps]
267+
resources: [deployments]
268+
verbs: [create, list, watch]
269+
- apiGroups: [apps]
270+
resources: [deployments]
271+
verbs: [get, update, patch, delete]
272+
resourceNames: [argocd-operator-controller-manager]
273+
---
274+
apiVersion: rbac.authorization.k8s.io/v1
275+
kind: RoleBinding
276+
metadata:
277+
name: argocd-installer-binding
278+
namespace: argocd
279+
roleRef:
280+
apiGroup: rbac.authorization.k8s.io
281+
kind: Role
282+
name: argocd-installer-role
283+
subjects:
284+
- kind: ServiceAccount
285+
name: argocd-installer
286+
namespace: argocd
287+
---
288+
apiVersion: olm.operatorframework.io/v1
289+
kind: ClusterExtension
290+
metadata:
291+
name: argocd
292+
spec:
293+
namespace: argocd
294+
serviceAccount:
295+
name: argocd-installer
296+
source:
297+
sourceType: Catalog
298+
catalog:
299+
packageName: argocd-operator
300+
version: 0.2.0
301+
```
302+
303+
If we view the current state of our ClusterExtension we should see that we have installed version 0.2.0:
304+
305+
```terminal
306+
kubectl get clusterextension argocd -o yaml | tail -n4
40307
```
41308

42-
* Update the version field in the ClusterExtension resource:
309+
!!! success "Command output"
310+
``` yaml
311+
install:
312+
bundle:
313+
name: argocd-operator.v0.2.0
314+
version: 0.2.0
315+
```
316+
317+
* To initiate our upgrade, let's update the version field in the ClusterExtension resource:
43318

44319
``` terminal
45320
kubectl apply -f - <<EOF
@@ -59,8 +334,8 @@ spec:
59334
EOF
60335
```
61336
62-
!!! success
63-
``` text title="Example output"
337+
!!! success "Command output"
338+
``` text
64339
clusterextension.olm.operatorframework.io/argocd configured
65340
```
66341
@@ -70,8 +345,8 @@ spec:
70345
kubectl patch clusterextension argocd --type='merge' -p '{"spec": {"source": {"catalog": {"version": "0.2.1"}}}}'
71346
```
72347
73-
!!! success
74-
``` text title="Example output"
348+
!!! success "Command output"
349+
``` text
75350
clusterextension.olm.operatorframework.io/argocd patched
76351
```
77352
@@ -81,8 +356,8 @@ spec:
81356
kubectl get clusterextension argocd -o yaml
82357
```
83358
84-
??? success
85-
``` text title="Example output"
359+
??? success "Updated ClusterExtension status"
360+
``` text
86361
apiVersion: olm.operatorframework.io/v1
87362
kind: ClusterExtension
88363
metadata:
@@ -151,3 +426,9 @@ spec:
151426
name: argocd-operator.v0.2.1
152427
version: 0.2.1
153428
```
429+
430+
!!! note "Note on `last-applied-configuration`"
431+
After your upgrade, the contents of the `kubectl.kubernetes.io/last-applied-configuration` annotation field will
432+
differ depending on your method of upgrade. If you apply a new ClusterExtension manifest as in the first method shown,
433+
the last applied configuration will show the new version since we replaced the existing manifest. If you use the patch
434+
method or `kubectl edit clusterextension`, then the last applied configuration will show the old version.

0 commit comments

Comments
 (0)