Skip to content

Commit 60f36e4

Browse files
Merge pull request #124 from wmedvede/SRVLOGIC-562
SRVLOGIC-562: DI, JS and Workflows migration from OSL 1.35.0 to OSL 1.36.0
2 parents bca7ba2 + a7d8f9e commit 60f36e4

2 files changed

Lines changed: 323 additions & 0 deletions

File tree

modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
***** xref:serverless-logic:cloud/operator/install-serverless-operator.adoc[Installation]
9292
***** Upgrade
9393
****** xref:serverless-logic:cloud/operator/upgrade-serverless-operator/upgrade_1_34_0_to_1_35_0.adoc[OSL 1.34.0 to 1.35.0]
94+
****** xref:serverless-logic:cloud/operator/upgrade-serverless-operator/upgrade_1_35_0_to_1_36_0.adoc[OSL 1.35.0 to 1.36.0]
9495
***** xref:serverless-logic:cloud/operator/global-configuration.adoc[Admin Configuration]
9596
***** xref:serverless-logic:cloud/operator/developing-workflows.adoc[Development Mode]
9697
***** xref:serverless-logic:cloud/operator/referencing-resource-files.adoc[Referencing Workflow Resources]
Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
= Upgrade {operator_name} from 1.35.0 to 1.36.0
2+
:compat-mode!:
3+
// Metadata:
4+
:description: Upgrade OSL Operator from 1.35.0 to 1.36.0
5+
:keywords: kogito, sonataflow, workflow, serverless, operator, kubernetes, minikube, openshift, containers
6+
// links
7+
8+
:openshift_operator_install_url: https://docs.openshift.com/container-platform/4.13/operators/admin/olm-adding-operators-to-cluster.html
9+
:openshift_operator_uninstall_url: https://docs.openshift.com/container-platform/4.13/operators/admin/olm-deleting-operators-from-cluster.html
10+
:kubernetes_operator_install_url: https://operatorhub.io/how-to-install-an-operator
11+
:kubernetes_operator_uninstall_url: https://olm.operatorframework.io/docs/tasks/uninstall-operator/
12+
:operatorhub_url: https://operatorhub.io/
13+
14+
// NOTE: Do not parametrize this guide, this is version specific migration guide, hence the versions are hardcoded.
15+
This guide describes how to upgrade the {operator_name} 1.35.0 installed in an OpenShift cluster to the version 1.36.0.
16+
17+
.Prerequisites
18+
* An OpenShift cluster with admin privileges and `oc` installed.
19+
20+
== Procedure
21+
22+
To upgrade an OSL 1.35.0 installation to the OSL 1.36.0 version, you must execute this procedure:
23+
24+
=== Overall upgrade procedure
25+
26+
It is recommended to read and understand all the steps of the procedure before executing.
27+
Interested parties might automate the procedure according to their convenience or infrastructure, for example, keeping all the `SonataFlow` CRDs in a GitHub repository, might help considerably to implement automation, etc.
28+
29+
. Execute the steps `1` and `2` of the upgrade for every workflow with the <<workflows_dev_profile, dev profile>>.
30+
. Execute the steps `1`, `2` and `3` of the upgrade for every workflow with the <<workflows_preview_profile, preview profile>>.
31+
. Execute the step `1` of the upgrade for every workflow with the <<workflows_gitops_profile, gitops profile>>.
32+
. Execute the step `1` of the <<data_index_upgrade, Data Index>> upgrade.
33+
. Execute the step `1` of the <<jobs_service_upgrade, Job Service>> upgrade.
34+
. Upgrade the OSL Operator to the version 1.36.0 <<operator_upgrade_procedure, following this procedure>>, and wait until the new version is running.
35+
. Finalize the <<data_index_upgrade, Data Index>> upgrade by continuing from step `2`.
36+
. Finalize the <<jobs_service_upgrade, Job Service>> upgrade by continuing from step `2`.
37+
. Finalize the upgrade for the workflows with the <<workflows_gitops_profile, gitops profile>> by continuing from step `2`.
38+
. Finalize the upgrade for the workflows with the <<workflows_preview_profile, preview profile>> by continuing from step `4`.
39+
. Finalize the upgrade for the workflows with the <<workflows_dev_profile, dev profile>> by continuing from step `3`.
40+
41+
[#workflows_dev_profile]
42+
==== Workflows with the `dev` profile
43+
44+
Every workflow with the `dev` profile must be deleted before applying the operator upgrade to OSL 1.36.0, and re-deployed after the upgrade is completed.
45+
46+
For every workflow `my-workflow` with the `dev` profile you must:
47+
48+
*Pre-operator upgrade steps:*
49+
50+
. Ensure that you have a copy of the corresponding `SonataFlow` CR, as well as any other Kubernetes resources created for that workflow. For example, this includes the user-provided `ConfigMap` with `application.properties` if you are using custom property configurations.
51+
52+
. Delete the workflow by using the following command:
53+
+
54+
[source,terminal]
55+
----
56+
$ oc delete -f <my-workflow.yaml> -n <target_namespace>
57+
----
58+
59+
*Post-operator upgrade steps:*
60+
61+
[start=3]
62+
. Ensure that any Kubernetes resource for that workflow, such as the user-provided `ConfigMap` with `application.properties`, is created before you redeploy the workflow.
63+
64+
. Re-deploy the workflow by using the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
69+
----
70+
71+
72+
[#workflows_preview_profile]
73+
==== Workflows with the `preview` profile
74+
Every workflow with the `preview` profile must be deleted before applying the operator upgrade to OSL 1.36.0 and then redeployed after the upgrade is complete.
75+
76+
For every workflow `my-workflow` with the `preview` profile you must:
77+
78+
*Pre-operator upgrade steps:*
79+
80+
. If the workflow is configured to use persistence, you must back up the workflow database.
81+
Ensure that your database backup includes all database objects, not just the table's information.
82+
83+
. Ensure that you have a copy of the corresponding `SonataFlow` CR, as well as any other Kubernetes resources created for that workflow. For example, if you are using custom property configurations, you will need a copy of the user-provided `ConfigMap` with the `application.properties` file.
84+
85+
. Delete the workflow by using the following command:
86+
+
87+
[source,terminal]
88+
----
89+
$ oc delete -f <my-workflow.yaml> -n <target_namespace>
90+
----
91+
92+
*Post-operator upgrade steps:*
93+
94+
[start=4]
95+
. Ensure that any Kubernetes resource for that workflow, such as the user-provided `ConfigMap` with `application.properties`, is created before you redeploy the workflow.
96+
97+
+
98+
. Re-deploy the workflow by using the following command.
99+
+
100+
[source,terminal]
101+
----
102+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
103+
----
104+
105+
[#workflows_gitops_profile]
106+
==== Workflows with the `gitops` profile
107+
108+
Every workflow with the `gitops` profile must be scaled to zero before applying the operator upgrade to OSL 1.36.0 and then rescaled to 1 after the upgrade is complete.
109+
110+
For every workflow `my-workflow` with the `gitops` profile you must:
111+
112+
*Pre-operator upgrade steps:*
113+
114+
. Scale the workflow to zero
115+
+
116+
You can scale the workflow to zero by configuring the field `spec.podTemplate.replicas: 0`, in the corresponding `my-workflow.yaml` `SonataFlow` CR, and executing:
117+
+
118+
[source,terminal]
119+
----
120+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
121+
----
122+
123+
*Post-operator upgrade steps:*
124+
125+
[start=2]
126+
. Rescale the workflow to 1:
127+
+
128+
You can rescale the workflow to 1 by configuring the field `spec.podTemplate.replicas: 1` in the corresponding `my-workflow.yaml` `SonataFlow` CR and executing:
129+
+
130+
[source,terminal]
131+
----
132+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
133+
----
134+
135+
[#data_index_upgrade]
136+
==== Data Index upgrade
137+
138+
Every Data Index deployment must be upgraded with the following procedure:
139+
140+
*Pre-operator upgrade steps:*
141+
142+
. Back up the Data Index database, including all database objects, not just the table information.
143+
144+
*Post-operator upgrade steps:*
145+
146+
[start=2]
147+
148+
. `data-index-process-definition` `Trigger` upgrade
149+
+
150+
If your Data Index installation is configured to use a Knative Eventing Kafka Broker to receive the workflow status change and definition events. In that case, you must delete the `data-index-process-definition` `Trigger` created by the OSL 1.35.0 version.
151+
152+
+
153+
You can see all the `Triggers` by executing the following command:
154+
+
155+
[source,terminal]
156+
----
157+
$ oc get triggers -n <target_namespace>
158+
----
159+
+
160+
161+
Example output:
162+
+
163+
164+
[source,terminal,subs="verbatim,quotes"]
165+
----
166+
Name Image
167+
NAME BROKER SUBSCRIBER_URI AGE READY REASON
168+
data-index-jobs-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/jobs 119m True
169+
*data-index-process-definition-473e1ddbb3ca1d62768187eb80de99bca example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/definitions 119m True*
170+
data-index-process-error-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/processes 119m True
171+
data-index-process-instance-mul07f593476e8c14353a337590e0bfd5ae example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/processes 119m True
172+
data-index-process-node-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/processes 119m True
173+
data-index-process-state-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/processes 119m True
174+
data-index-process-variable-487e9a6777fff650e60097c9e17111aea25 example-broker http://sonataflow-platform-data-index-service.<target_namespace>.svc.cluster.local/processes 119m True
175+
176+
jobs-service-create-job-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-jobs-service.<target_namespace>.svc.cluster.local/v2/jobs/events 119m True
177+
jobs-service-delete-job-a25c8405-f740-47d2-a9a5-f80ccaec2955 example-broker http://sonataflow-platform-jobs-service.<target_namespace>.svc.cluster.local/v2/jobs/events 119m True
178+
----
179+
+
180+
181+
Following the example above, the `Trigger` `data-index-process-definition-473e1ddbb3ca1d62768187eb80de99bca` must be deleted with the following command:
182+
183+
+
184+
[source,terminal]
185+
----
186+
$ oc delete trigger data-index-process-definition-473e1ddbb3ca1d62768187eb80de99bca -n <target_namespace>
187+
----
188+
+
189+
After the command is executed, the old `Trigger` will be deleted, and a new `Trigger` compatible with OSL 1.36.0 will be automatically created.
190+
191+
. *(Optional)* Some time after the OSL Operator 1.36.0 upgrade is completed, you’ll see that a new `ReplicaSet` for executing the Data Index 1.36.0 version is created.
192+
+
193+
You can optionally delete all the Data Index old ReplicaSets belonging to the OSL 1.35.0 using these commands.
194+
+
195+
You can see all the ReplicaSets by executing a query like this:
196+
+
197+
[source,terminal]
198+
----
199+
$ oc get replicasets -o custom-columns=Name:metadata.name,Image:spec.template.spec.containers[*].image -n <target_namespace>
200+
----
201+
+
202+
Example output:
203+
+
204+
205+
[source,terminal,subs="verbatim,quotes"]
206+
----
207+
Name Image
208+
*sonataflow-platform-data-index-service-1111111111 registry.redhat.io/openshift-serverless-1/logic-data-index-postgresql-rhel8:1.35.0*
209+
210+
sonataflow-platform-data-index-service-2222222222 registry.redhat.io/openshift-serverless-1/logic-data-index-postgresql-rhel8:1.36.0
211+
----
212+
+
213+
Following the example above, the old OSL 1.35.0 ReplicaSet `sonataflow-platform-data-index-service-1111111111` must be deleted with the following command:
214+
+
215+
[source,terminal]
216+
----
217+
$ oc delete replicaset sonataflow-platform-data-index-service-1111111111 -n <target_namespace>
218+
----
219+
220+
[#jobs_service_upgrade]
221+
==== Job Service upgrade
222+
223+
Every Job Service deployment must be upgraded with the following procedure:
224+
225+
*Pre-operator upgrade steps:*
226+
227+
. Back up the Job Service database, including all database objects, not just the table information.
228+
229+
*Post-operator upgrade steps:*
230+
231+
[start=2]
232+
. *(Optional)* Some time after the OSL Operator 1.36.0 upgrade is completed, you’ll see that a new `ReplicaSet` for executing the Job Service 1.36.0 version is created.
233+
+
234+
You can optionally delete all the Job Service old ReplicaSets belonging to the OSL 1.35.0 using these commands.
235+
+
236+
You can see all the ReplicaSets by executing a query like this:
237+
+
238+
[source,terminal]
239+
----
240+
$ oc get replicasets -o custom-columns=Name:metadata.name,Image:spec.template.spec.containers[*].image -n <target_namespace>
241+
----
242+
+
243+
Example output:
244+
+
245+
246+
[source,terminal,subs="verbatim,quotes"]
247+
----
248+
Name Image
249+
*sonataflow-platform-jobs-service-1111111111 registry.redhat.io/openshift-serverless-1/logic-jobs-service-postgresql-rhel8:1.35.0*
250+
251+
sonataflow-platform-jobs-service-2222222222 registry.redhat.io/openshift-serverless-1/logic-jobs-service-postgresql-rhel8:1.36.0
252+
----
253+
+
254+
Following the example above, the old OSL 1.35.0 ReplicaSet `sonataflow-platform-jobs-service-1111111111` must be deleted with the following command:
255+
+
256+
[source,terminal]
257+
----
258+
$ oc delete replicaset sonataflow-platform-jobs-service-1111111111 -n <target_namespace>
259+
----
260+
261+
[#operator_upgrade_procedure]
262+
==== Operator Upgrade Procedure
263+
To upgrade the OSL Operator from 1.35.0 to 1.36.0 you must execute these steps:
264+
265+
. Patch the CVS 1.35.0 by executing this command:
266+
+
267+
[source,terminal]
268+
----
269+
$ oc patch csv logic-operator-rhel8.v1.35.0 \
270+
-n openshift-serverless-logic \
271+
--type=json \
272+
-p='[
273+
{
274+
"op": "replace",
275+
"path": "/spec/install/spec/deployments/0/spec/selector/matchLabels",
276+
"value": {
277+
"app.kubernetes.io/name": "sonataflow-operator"
278+
}
279+
},
280+
{
281+
"op": "replace",
282+
"path": "/spec/install/spec/deployments/0/label",
283+
"value": {
284+
"app.kubernetes.io/name": "sonataflow-operator"
285+
}
286+
},
287+
{
288+
"op": "replace",
289+
"path": "/spec/install/spec/deployments/0/spec/template/metadata/labels",
290+
"value": {
291+
"app.kubernetes.io/name": "sonataflow-operator"
292+
}
293+
}
294+
]'
295+
----
296+
+
297+
. Delete current operator deployment by executing this command:
298+
+
299+
[source,terminal]
300+
----
301+
$ oc delete deployment logic-operator-rhel8-controller-manager -n openshift-serverless-logic
302+
----
303+
. Upgrade the Operator to OSL 1.36.0 using the OpenShift management console
304+
+
305+
. After applying the upgrade, execute the following command to check if the operator is running properly.
306+
It might take some time to get the Succeeded status:
307+
+
308+
[source,terminal]
309+
----
310+
$ oc get clusterserviceversion logic-operator-rhel8.v1.36.0
311+
----
312+
+
313+
You must get an output like this:
314+
+
315+
[source,terminal]
316+
----
317+
NAME DISPLAY VERSION REPLACES PHASE
318+
logic-operator-rhel8.v1.36.0 OpenShift Serverless Logic Operator 1.36.0 logic-operator-rhel8.v1.35.0 Succeeded
319+
----
320+
321+
322+
include::../../../../pages/_common-content/report-issue.adoc[]

0 commit comments

Comments
 (0)