|
| 1 | += Upgrade {operator_name} from 1.34.0 to 1.35.0 |
| 2 | +:compat-mode!: |
| 3 | +// Metadata: |
| 4 | +:description: Upgrade OSL Operator from 1.34.0 to 1.35.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 | +This guide describes how to upgrade the {operator_name} 1.34.0 installed in an OpenShift cluster to the version 1.35.0. |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | +* An OpenShift cluster with admin privileges and `oc` installed. |
| 18 | +
|
| 19 | +
|
| 20 | +
|
| 21 | +== Procedure |
| 22 | + |
| 23 | +To upgrade an OSL 1.34.0 installation to the OSL 1.35.0 version, you must execute this procedure: |
| 24 | + |
| 25 | +=== Overall upgrade procedure |
| 26 | + |
| 27 | +It is recommended to read and understand all the steps of the procedure before executing. |
| 28 | +Interested parties might automate the procedure according to their convenience or infrastructure, for example, a particular user might have all the SonataFlow CRDs in a GitHub repository, which might help considerably to implement automation, etc. |
| 29 | + |
| 30 | +. Execute the step `1` of the upgrade for every workflow with the <<workflows_dev_profile, dev profile>>. |
| 31 | +. Execute the steps `1`, `2` and `3` of the upgrade for every workflow with the <<workflows_preview_profile, preview profile>>. |
| 32 | +. Execute the step `1` of the upgrade for every workflow with the <<workflows_gitops_profile, gitops profile>>. |
| 33 | +. Execute the step `1` of the <<data_index_upgrade, Data Index>> upgrade. |
| 34 | +. Execute the step `1` of the <<jobs_service_upgrade, Jobs Service>> upgrade. |
| 35 | +. Upgrade the OSL operator to the version 1.35.0 using the OpenShift management console, and wait until the new version is running, <<check_if_operator_is_updated, see>>. |
| 36 | +. Finalize the <<data_index_upgrade, Data Index>> upgrade by continuing from step `2`. |
| 37 | +. Finalize the <<jobs_service_upgrade, Jobs Service>> upgrade by continuing from step `2`. |
| 38 | +. Finalize the upgrade for the workflows with the <<workflows_gitops_profile, gitops profile>> by continuing from step `2`. |
| 39 | +. Finalize the upgrade for the workflows with the <<workflows_preview_profile, preview profile>> by continuing from step `4`. |
| 40 | +. Finalize the upgrade for the workflows with the <<workflows_dev_profile, dev profile>> by continuing from step `2`. |
| 41 | + |
| 42 | +[#workflows_dev_profile] |
| 43 | +==== Workflows with the `dev` profile |
| 44 | + |
| 45 | +You must delete every workflow with the `dev` profile before applying the operator upgrade to OSL 1.35.0 and re-deployed after the upgrade is completed. |
| 46 | + |
| 47 | +For every workflow `my-workflow` with the `dev` profile you must: |
| 48 | + |
| 49 | +*Pre-operator upgrade steps:* |
| 50 | + |
| 51 | +. Delete the workflow by using the following command: |
| 52 | ++ |
| 53 | +[source,terminal] |
| 54 | +---- |
| 55 | +$ oc delete -f <my-workflow.yaml> -n <target_namespace> |
| 56 | +---- |
| 57 | ++ |
| 58 | +Ensure that you have a copy of the corresponding SonataFlow CRD, as well as any other k8s resource created for that workflow, for example, the user provided ConfigMap with the application.properties in cases you are using custom properties configurations, etc. |
| 59 | + |
| 60 | +*Post-operator upgrade steps:* |
| 61 | + |
| 62 | +[start=2] |
| 63 | +. Re-deploy the workflow. |
| 64 | ++ |
| 65 | +Ensure that any k8s resource for that workflow, for example, the user-provided ConfigMap with the `application.properties`, is created before you re-deploy the workflow. |
| 66 | + |
| 67 | +[#workflows_preview_profile] |
| 68 | +==== Workflows with the `preview` profile |
| 69 | +Every workflow with the `preview` profile must be deleted before applying the operator upgrade to OSL 1.35.0 and re-deployed after the upgrade is completed. |
| 70 | + |
| 71 | +For every workflow `my-workflow` with the `preview` profile you must: |
| 72 | + |
| 73 | +*Pre-operator upgrade steps:* |
| 74 | + |
| 75 | +. If the workflow is configured to use persistence, you must back up the workflow database. |
| 76 | +Ensure that your database backup includes the database objects, and not only the table's information. |
| 77 | + |
| 78 | +. Delete the workflow by using the following command: |
| 79 | ++ |
| 80 | +[source,terminal] |
| 81 | +---- |
| 82 | +$ oc delete -f <my-workflow.yaml> -n <target_namespace> |
| 83 | +---- |
| 84 | ++ |
| 85 | +Ensure that you have a copy of the corresponding SonataFlow CRD, as well as any other k8s resource created for that workflow, for example, the user provided ConfigMap with the `application.properties` in case you are using custom properties configurations. |
| 86 | + |
| 87 | +. If the workflow is configured to use persistence, you must execute the xref:attachment$cloud/operator/upgrade-serverless-operator/migrate-workflow-db-from_1.34.0_to_1.35.0.sql[migrate-workflow-db-from_1.34.0_to_1.35.0.sql] script in the workflow database. |
| 88 | + |
| 89 | +*Post-operator upgrade steps:* |
| 90 | + |
| 91 | +[start=4] |
| 92 | +. If the workflow is configured to use persistence, you must add the following property in the workflow ConfigMap that contains the application.properties: |
| 93 | ++ |
| 94 | +[source,yaml] |
| 95 | +---- |
| 96 | +apiVersion: v1 |
| 97 | +kind: ConfigMap |
| 98 | +metadata: |
| 99 | + labels: |
| 100 | + app: my-workflow |
| 101 | + name: my-workflow-props |
| 102 | +data: |
| 103 | + application.properties: | |
| 104 | + kie.flyway.enabled=true |
| 105 | +---- |
| 106 | ++ |
| 107 | +Be sure that any k8s resource for that workflow, for example, the user provided ConfigMap with the application.properties, is created before you re-deploy the workflow. |
| 108 | + |
| 109 | +[#workflows_gitops_profile] |
| 110 | +==== Workflows with the `gitops` profile |
| 111 | + |
| 112 | +Every workflow with the `gitops` profile must be scaled to zero before applying the operator upgrade to OSL 1.35.0 and rescaled to 1 after the upgrade is completed. |
| 113 | + |
| 114 | +For every workflow `my-workflow` with the `gitops` profile you must: |
| 115 | + |
| 116 | +*Pre-operator upgrade steps:* |
| 117 | + |
| 118 | +. Scale the workflow to zero |
| 119 | ++ |
| 120 | +You can scale the workflow to zero by configuring the field `spec.podTemplate.replicas: 0`, in the corresponding `my-workflow.yaml` SonataFlow CRD, and executing: |
| 121 | ++ |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +$ oc apply -f <my-workflow.yaml> -n <target_namespace> |
| 125 | +---- |
| 126 | + |
| 127 | +*Post-operator upgrade steps:* |
| 128 | + |
| 129 | +[start=2] |
| 130 | +. Rescale the workflow to 1: |
| 131 | ++ |
| 132 | +You can rescale the workflow to 1, by configuring the field `spec.podTemplate.replicas: 1`, in the corresponding `my-workflow.yaml` SonataFlow CRD, and executing: |
| 133 | ++ |
| 134 | +[source,terminal] |
| 135 | +---- |
| 136 | +$ oc apply -f <my-workflow.yaml> -n <target_namespace> |
| 137 | +---- |
| 138 | + |
| 139 | +[#data_index_upgrade] |
| 140 | +==== Data Index upgrade |
| 141 | + |
| 142 | +Every data index deployment must be upgraded with the following procedure: |
| 143 | + |
| 144 | +*Pre-operator upgrade steps:* |
| 145 | + |
| 146 | +. Backup the data index database. (including the database objects, and not only the tables information) |
| 147 | + |
| 148 | +*Post-operator upgrade steps:* |
| 149 | + |
| 150 | +[start=2] |
| 151 | +. Some time after the OSL Operator 1.35.0 upgrade was executed, you’ll see that a new ReplicaSet for executing the data index 1.35.0 version was created. |
| 152 | ++ |
| 153 | +All the data index replicasets for the OSL 1.34.0 must be deleted. |
| 154 | ++ |
| 155 | +You can see all the replicasets by executing a query like this: |
| 156 | ++ |
| 157 | +[source,terminal] |
| 158 | +---- |
| 159 | +$ oc get replicasets -o custom-columns=Name:metadata.name,Image:spec.template.spec.containers[*].image -n <target_namespace> |
| 160 | +---- |
| 161 | ++ |
| 162 | +Example output: |
| 163 | ++ |
| 164 | + |
| 165 | +[source,terminal] |
| 166 | +---- |
| 167 | +Name Image |
| 168 | +sonataflow-platform-data-index-service-1111111111 registry.redhat.io/openshift-serverless-1/logic-data-index-postgresql-rhel8:1.34.0 |
| 169 | +
|
| 170 | +sonataflow-platform-data-index-service-222222222 registry.redhat.io/openshift-serverless-1/logic-data-index-postgresql-rhel8:1.35.0 |
| 171 | +---- |
| 172 | ++ |
| 173 | +Following the example above, the replicaset sonataflow-platform-data-index-service-1111111111 must be deleted with the following command: |
| 174 | ++ |
| 175 | +[source,terminal] |
| 176 | +---- |
| 177 | +$ oc delete replicaset sonataflow-platform-data-index-service-1111111111 -n <target_namespace> |
| 178 | +---- |
| 179 | + |
| 180 | +[#jobs_service_upgrade] |
| 181 | +==== Jobs Service upgrade |
| 182 | + |
| 183 | +Every jobs service deployment must be upgraded with the following procedure: |
| 184 | + |
| 185 | +*Pre-operator upgrade steps:* |
| 186 | + |
| 187 | +. Backup the jobs service database. (including the database objects, and not only the tables information) |
| 188 | + |
| 189 | +*Post-operator upgrade steps:* |
| 190 | + |
| 191 | +[start=2] |
| 192 | +. When the OSL Operator 1.35.0 upgrade was executed, and the new OSL Operator Pod started, every job's service Deployment must be deleted. |
| 193 | ++ |
| 194 | +This will cause the automatic clean-up of the OSL 1.34.0 jobs service Pod and ReplicaSets, and the generation of new ones in OSL 1.35.0 |
| 195 | + |
| 196 | +[#check_if_operator_is_updated] |
| 197 | +==== Check if the new Operator version running |
| 198 | + |
| 199 | +After applying the upgrade, you can execute the following command to check if the operator is running properly: |
| 200 | +[source,terminal] |
| 201 | +---- |
| 202 | +$ oc get clusterserviceversion logic-operator-rhel8.v1.35.0 |
| 203 | +---- |
| 204 | + |
| 205 | +You must get an output like this: |
| 206 | + |
| 207 | +[source,terminal] |
| 208 | +---- |
| 209 | +NAME DISPLAY VERSION REPLACES PHASE |
| 210 | +logic-operator-rhel8.v1.35.0 OpenShift Serverless Logic Operator 1.35.0 logic-operator-rhel8.v1.34.0 Succeeded |
| 211 | +---- |
| 212 | + |
| 213 | + |
| 214 | +include::../../../../pages/_common-content/report-issue.adoc[] |
0 commit comments