Skip to content

Commit d0f5827

Browse files
authored
Merge pull request #93855 from openshift-cherrypick-robot/cherry-pick-90790-to-serverless-docs-1.36
[serverless-docs-1.36] PR for SRVLOGIC-524: Add the section to upgrade Serverless Logic Operator from 1.34.0 to 1.35.0
2 parents d7a7c64 + 493c89b commit d0f5827

18 files changed

+422
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ Topics:
407407
File: serverless-logic-managing-persistence
408408
- Name: Workflow eventing system
409409
File: serverless-logic-workflow-eventing-system
410+
- Name: Managing upgrades
411+
Dir: serverless-logic-managing-upgrades
412+
Topics:
413+
- Name: Upgrading Serverless Logic Operator from 1.34.0 to 1.35.0
414+
File: serverless-logic-upgrading-operator-from-1.34-to-1.35
415+
410416
---
411417
# Knative kn CLI
412418
Name: Knative CLI
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-backing-up-data-index-database_{context}"]
7+
= Backing up the Data Index database
8+
9+
You must back up the Data Index database before upgrading to prevent data loss.
10+
11+
.Procedure
12+
13+
* Take a full backup of the Data Index database, ensuring:
14+
** The backup includes all database objects and not just table data.
15+
** The backup is stored in a secure location.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-backing-up-job-service-database_{context}"]
7+
= Backing up the Jobs Service database
8+
9+
You must back up the Jobs Service database before upgrading to maintain job scheduling data.
10+
11+
.Procedure
12+
13+
* Take a full backup of the Jobs Service database, ensuring:
14+
** The backup includes all database objects and not just table data.
15+
** The backup is stored in a secure location.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-deleting-migrating-workflows-with-preview-profile_{context}"]
7+
= Deleting and migrating workflows with the preview profile
8+
9+
Before upgrading the Operator, you must delete workflows running with the `Preview` profile, and migrate any data that is persisted. When the upgrade is completed, you must redeploy the workflows.
10+
11+
.Procedure
12+
13+
. If you are using persistence, back up the workflow database and ensure the backup includes both database objects and table data.
14+
15+
. Ensure you have a backup of all necessary Kubernetes resources, including `SonataFlow` CRDs, `ConfigMaps`, or any other related custom configurations.
16+
17+
. Delete the workflow by executing the following command:
18+
+
19+
[source,terminal]
20+
----
21+
$ oc delete -f <my-workflow.yaml> -n <target_namespace>
22+
----
23+
24+
. If you are using persistence, you must execute the following database migration script:
25+
+
26+
[source,sql]
27+
----
28+
ALTER TABLE flyway_schema_history
29+
RENAME CONSTRAINT flyway_schema_history_pk TO kie_flyway_history_runtime_persistence_pk;
30+
31+
ALTER INDEX flyway_schema_history_s_idx
32+
RENAME TO kie_flyway_history_runtime_persistence_s_idx;
33+
34+
ALTER TABLE flyway_schema_history RENAME TO kie_flyway_history_runtime_persistence;
35+
----
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-deleting-workflows-with-dev-profile_{context}"]
7+
= Deleting workflows with dev profile
8+
9+
Before upgrading the Operator, you must delete workflows running with the `dev` profile and redeploy them after the upgrade is completed.
10+
11+
.Procedure
12+
13+
. Ensure you have a backup of all necessary Kubernetes resources, including `SonataFlow` custom resource definitions (CRDs), `ConfigMaps`, or any other related custom configurations.
14+
15+
. Delete the workflow by executing the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc delete -f <my-workflow.yaml> -n <target_namespace>
20+
----
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-finalizing-data-index_{context}"]
7+
= Finalizing the Data Index upgrade
8+
9+
After the Operator upgrade, a new ReplicaSet is automatically created for Data Index 1.35.0. You must delete the old one manually.
10+
11+
.Procedure
12+
13+
. Verify the new ReplicaSet exists by listing all ReplicaSets by running the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc get replicasets -n <target_namespace> -o custom-columns=Name:metadata.name,Image:spec.template.spec.containers[*].image
18+
----
19+
20+
. Identify the old Data Index ReplicaSet (with version 1.34.0) and delete it:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc delete replicaset <old_replicaset_name> -n <target_namespace>
25+
----
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-finalizing-job-service_{context}"]
7+
= Finalizing the Job Service upgrade
8+
9+
You must manually clean up the Jobs Service components from the older version to trigger deployment of version 1.35.0 components.
10+
11+
.Procedure
12+
13+
. Delete the old Jobs Service deployment by running the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc delete deployment <jobs-service-deployment-name> -n <target_namespace>
18+
----
19+
+
20+
This will trigger automatic cleanup of the older Pods and ReplicaSets and initiate a fresh deployment using version 1.35.0.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-redeploying-workflows-with-dev-profile_{context}"]
7+
= Redeploying workflows with the dev profile
8+
9+
After the upgrade, you must redeploy workflows that use the `dev` profile and any associated Kubernetes resources.
10+
11+
.Procedure
12+
13+
. Ensure all required resources are restored, including `SonataFlow` CRDs, `ConfigMaps`, or any other related custom configurations.
14+
15+
. Redeploy the workflow by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
20+
----
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-restoring-workflows-with-preview-profile_{context}"]
7+
= Restoring workflows with the preview profile
8+
9+
Workflows with the `preview` profile require an additional configuration step before being redeployed.
10+
11+
.Procedure
12+
13+
. If the workflow uses persistence, add the following property to the `ConfigMap` associated with the workflow:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: v1
18+
kind: ConfigMap
19+
metadata:
20+
labels:
21+
app: my-workflow
22+
name: my-workflow-props
23+
data:
24+
application.properties: |
25+
kie.flyway.enabled=true
26+
----
27+
28+
. Ensure all required resources are recreated, including `SonataFlow` CRDs, `ConfigMaps`, or any other related custom configurations.
29+
30+
. Redeploy the workflow by running the following command:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
35+
----
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-upgrading-operator-from-1.34-to-1.35
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-upgrade-scaling-down-workflows-with-gitops-profile_{context}"]
7+
= Scaling down workflows with the gitops profile
8+
9+
Before upgrading the Operator, you must scale down workflows running with the `gitops` profile, and scale them up again after the upgrade is completed.
10+
11+
.Procedure
12+
13+
. Modify the `my-workflow.yaml` CRD and scale down each workflow to `zero` before upgrading as shown in the following example:
14+
+
15+
[source,yaml]
16+
----
17+
spec:
18+
podTemplate:
19+
replicas: 0
20+
----
21+
22+
. Apply the updated CRD by running the following command:
23+
+
24+
[source,terminal]
25+
----
26+
$ oc apply -f <my-workflow.yaml> -n <target_namespace>
27+
----
28+
29+
. (Optional) Scale the workflow to `0` by running the following command:
30+
+
31+
[source,terminal]
32+
----
33+
$ oc patch sonataflow <my-workflow> -n <target_namespace> --type=merge -p '{"spec": {"podTemplate": {"replicas": 0}}}'
34+
----

0 commit comments

Comments
 (0)