This documentation is for a release that is no longer maintained
See documentation for the latest supported version.Chapter 5. Upgrading OpenShift Dev Spaces
This chapter describes how to upgrade from CodeReady Workspaces 2.15 to OpenShift Dev Spaces 3.0.
5.1. Upgrading the dsc management tool Copy linkLink copied to clipboard!
This section describes how to upgrade the dsc
management tool.
5.2. Upgrading CodeReady Workspaces 2.15 on Red Hat OpenShift Copy linkLink copied to clipboard!
The workspace engine and authentication system used in CodeReady Workspaces 2.15 and earlier versions are deprecated. Due to this deprecation, upgrading CodeReady Workspaces 2.15 involves running upgrade scripts.
5.2.1. Manually upgrading CodeReady Workspaces 2.15 to OpenShift Dev Spaces 3.0.1 on Red Hat OpenShift Copy linkLink copied to clipboard!
You can manually upgrade CodeReady Workspaces 2.15 to OpenShift Dev Spaces 3.0.1 on Red Hat OpenShift.
Prerequisites
- OpenShift Container Platform 4.10 or OpenShift Dedicated 4.10 or Red Hat OpenShift Service on AWS (ROSA) 4.10.
- An instance of CodeReady Workspaces deployed on one of the Section 1.1, “Supported platforms”. The instance uses the default internal PostgreSQL database and has OAuth enabled on Red Hat OpenShift. See Red Hat CodeReady Workspaces 2.15 - Configuring OpenShift OAuth.
The following command line tools are available:
-
oc
-
curl
-
jq
-
- The host running the upgrade commands is running on Linux.
Optional:
- All changes from all workspaces have been committed and pushed to their Git remotes.
- All workspaces have been stopped to avoid UX degradation.
- The CodeReady Workspaces data have been backed up. See Red Hat CodeReady Workspaces 2.15 - Backup and recovery.
Procedure
Download 1-prepare.sh.
1-prepare.sh
shuts down CodeReady Workspaces and RH-SSO, fetches the existing users' data, and dumps the CodeReady Workspaces database.Download 2-migrate.sh.
2-migrate.sh
fetches CodeReady Workspaces RH-SSO and database data, and repopulates the database with updated data.Download 3-subscribe.sh.
3-subscribe.sh
deletes CodeReady Workspaces Operator and RH-SSO resources, updates the CheCluster CR, and creates a new OpenShift Dev Spaces Operator subscription.Download 4-wait.sh.
4-wait.sh
waits until OpenShift Dev Spaces is ready, which can take more than 5 minutes.Set the environment variables to use in the upgrade scripts:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the upgrade scripts:
chmod +x ./1-prepare.sh ./2-migrate.sh ./3-subscribe.sh ./4-wait.sh; \ ./1-prepare.sh && ./2-migrate.sh && ./3-subscribe.sh && ./4-wait.sh
$ chmod +x ./1-prepare.sh ./2-migrate.sh ./3-subscribe.sh ./4-wait.sh; \ ./1-prepare.sh && ./2-migrate.sh && ./3-subscribe.sh && ./4-wait.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
In the OpenShift Dev Spaces dashboard, go to
to verify that it is 3.0.
5.2.2. Rolling the upgrade back to CodeReady Workspaces 2.15 on Red Hat OpenShift Copy linkLink copied to clipboard!
If upgrading CodeReady Workspaces 2.15 to OpenShift Dev Spaces 3.0.1 on Red Hat OpenShift fails, you can run a rollback script to restore CodeReady Workspaces 2.15.
Prerequisites
- OpenShift Container Platform 4.10 or OpenShift Dedicated 4.10 or Red Hat OpenShift Service on AWS (ROSA) 4.10.
Procedure
- Download the rollback.sh script.
Set the environment variables to use in the
rollback.sh
script:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
rollback.sh
script.chmod +x ./rollback.sh; ./rollback.sh
$ chmod +x ./rollback.sh; ./rollback.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
In the CodeReady Workspaces dashboard, go to
to verify that it is 2.15.
5.3. Specifying the update approval strategy for the Red Hat OpenShift Dev Spaces Operator Copy linkLink copied to clipboard!
The Red Hat OpenShift Dev Spaces Operator supports two upgrade strategies:
Automatic
- The Operator installs new updates when they become available.
Manual
- New updates need to be manually approved before installation begins.
You can specify the update approval strategy for the Red Hat OpenShift Dev Spaces Operator by using the OpenShift web console.
Prerequisites
- An OpenShift web console session by a cluster administrator. See Accessing the web console.
- An instance of OpenShift Dev Spaces that was installed by using Red Hat Ecosystem Catalog.
Procedure
-
In the OpenShift web console, navigate to
. - Click Red Hat OpenShift Dev Spaces in the list of installed Operators.
- Navigate to the Subscription tab.
-
Configure the Update approval strategy to
Automatic
orManual
.
Additional resources
5.4. Upgrading OpenShift Dev Spaces using the OpenShift web console Copy linkLink copied to clipboard!
You can manually approve an upgrade from an earlier minor version using the Red Hat OpenShift Dev Spaces Operator from the Red Hat Ecosystem Catalog in the OpenShift web console.
Prerequisites
- An OpenShift web console session by a cluster administrator. See Accessing the web console.
- An instance of OpenShift Dev Spaces that was installed by using the Red Hat Ecosystem Catalog.
-
The approval strategy in the subscription is
Manual
. See Section 5.3, “Specifying the update approval strategy for the Red Hat OpenShift Dev Spaces Operator”.
Procedure
- Manually approve the pending Red Hat OpenShift Dev Spaces Operator upgrade. See Manually approving a pending Operator upgrade.
Verification steps
- Navigate to the OpenShift Dev Spaces instance.
- The 3.0 version number is visible at the bottom of the page.
Additional resources
5.5. Repairing the DevWorkspace Operator on OpenShift Copy linkLink copied to clipboard!
Under certain conditions, such as OLM restart or cluster upgrade, the Dev Spaces Operator for OpenShift Dev Spaces might automatically install the DevWorkspace Operator even when it is already present on the cluster. In that case, you can repair the DevWorkspace Operator on OpenShift as follows:
Prerequisites
-
An active
oc
session as a cluster administrator to the destination OpenShift cluster. See Getting started with the CLI. - On the Installed Operators page of the OpenShift web console, you see multiple entries for the DevWorkspace Operator or one entry that is stuck in a loop of Replacing and Pending.
Procedure
-
Delete the
devworkspace-controller
namespace that contains the failing pod. Update
DevWorkspace
andDevWorkspaceTemplate
Custom Resource Definitions (CRD) by setting the conversion strategy toNone
and removing the entirewebhook
section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipYou can find and edit the
DevWorkspace
andDevWorkspaceTemplate
CRDs in the Administrator perspective of the OpenShift web console by searching forDevWorkspace
in. NoteThe
DevWorkspaceOperatorConfig
andDevWorkspaceRouting
CRDs have the conversion strategy set toNone
by default.Remove the DevWorkspace Operator subscription:
oc delete sub devworkspace-operator \ -n openshift-operators
$ oc delete sub devworkspace-operator \ -n openshift-operators
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
openshift-operators
or an OpenShift project where the DevWorkspace Operator is installed.
Get the DevWorkspace Operator CSVs in the <devworkspace-operator.vX.Y.Z> format:
oc get csv | grep devworkspace
$ oc get csv | grep devworkspace
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove each DevWorkspace Operator CSV:
oc delete csv <devworkspace-operator.vX.Y.Z> \ -n openshift-operators
$ oc delete csv <devworkspace-operator.vX.Y.Z> \ -n openshift-operators
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
openshift-operators
or an OpenShift project where the DevWorkspace Operator is installed.
Re-create the DevWorkspace Operator subscription:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
Automatic
orManual
.
ImportantFor
installPlanApproval: Manual
, in the Administrator perspective of the OpenShift web console, go toand select the following for the DevWorkspace Operator: . -
In the Administrator perspective of the OpenShift web console, go to
and verify the Succeeded status of the DevWorkspace Operator.