Chapter 6. Upgrading Dev Spaces
This chapter describes how to upgrade from CodeReady Workspaces 3.1 to OpenShift Dev Spaces 3.10.
6.1. Upgrading the chectl management tool
This section describes how to upgrade the dsc
management tool.
6.2. Specifying the update approval strategy
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
6.3. Upgrading Dev Spaces using the OpenShift web console
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 6.2, “Specifying the update approval strategy”.
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.10 version number is visible at the bottom of the page.
Additional resources
6.4. Upgrading Dev Spaces using the CLI management tool
This section describes how to upgrade from the previous minor version using the CLI management tool.
Prerequisites
- An administrative account on OpenShift.
-
A running instance of a previous minor version of CodeReady Workspaces, installed using the CLI management tool on the same instance of OpenShift, in the
openshift-devspaces
OpenShift project. -
dsc
for OpenShift Dev Spaces version 3.10. See: Section 1.2, “Installing the dsc management tool”.
Procedure
- Save and push changes back to the Git repositories for all running CodeReady Workspaces 3.1 workspaces.
- Shut down all workspaces in the CodeReady Workspaces 3.1 instance.
Upgrade OpenShift Dev Spaces:
$ dsc server:update -n openshift-devspaces
NoteFor slow systems or internet connections, add the
--k8spodwaittimeout=1800000
flag option to extend the Pod timeout period to 1800000 ms or longer.
Verification steps
- Navigate to the OpenShift Dev Spaces instance.
- The 3.10 version number is visible at the bottom of the page.
6.5. Upgrading Dev Spaces in a restricted environment
This section describes how to upgrade Red Hat OpenShift Dev Spaces and perform minor version updates by using the CLI management tool in a restricted environment.
Prerequisites
-
The OpenShift Dev Spaces instance was installed on OpenShift using the
dsc --installer operator
method in theopenshift-devspaces
project. See Section 2.3, “Installing Dev Spaces in a restricted environment”.
- The OpenShift cluster has at least 64 GB of disk space.
- The OpenShift cluster is ready to operate on a restricted network, and the OpenShift control plane has access to the public internet. See About disconnected installation mirroring and Using Operator Lifecycle Manager on restricted networks.
-
An active
oc
session with administrative permissions to the OpenShift cluster. See Getting started with the OpenShift CLI. -
An active
oc registry
session to theregistry.redhat.io
Red Hat Ecosystem Catalog. See: Red Hat Container Registry authentication.
-
opm
. See Installing theopm
CLI. -
jq
. See Downloadingjq
. -
podman
. See Podman Installation Instructions. -
skopeo
version 1.6 or higher. See Installing Skopeo. -
An active
skopeo
session with administrative access to the private Docker registry. Authenticating to a registry, and Mirroring images for a disconnected installation. -
dsc
for OpenShift Dev Spaces version 3.10. See Section 1.2, “Installing the dsc management tool”.
Procedure
Download and execute the mirroring script to install a custom Operator catalog and mirror the related images: prepare-restricted-environment.sh.
$ bash prepare-restricted-environment.sh \ --devworkspace_operator_index registry.redhat.io/redhat/redhat-operator-index:v4.13\ --devworkspace_operator_version "v0.21.0" \ --prod_operator_index "registry.redhat.io/redhat/redhat-operator-index:v4.13" \ --prod_operator_package_name "devspaces" \ --prod_operator_bundle_name "devspacesoperator" \ --prod_operator_version "v3.10.0" \ --my_registry "<my_registry>" 1
- 1
- The private Docker registry where the images will be mirrored
- In all running workspaces in the CodeReady Workspaces 3.1 instance, save and push changes back to the Git repositories.
- Stop all workspaces in the CodeReady Workspaces 3.1 instance.
Run the following command:
$ dsc server:update --che-operator-image="$TAG" -n openshift-devspaces --k8spodwaittimeout=1800000
Verification steps
- Navigate to the OpenShift Dev Spaces instance.
- The 3.10 version number is visible at the bottom of the page.
Additional resources
6.6. Repairing the Dev Workspace Operator on OpenShift
Under certain conditions, such as OLM restart or cluster upgrade, the Dev Spaces Operator for OpenShift Dev Spaces might automatically install the Dev Workspace Operator even when it is already present on the cluster. In that case, you can repair the Dev Workspace 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 Dev Workspace 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:spec: ... conversion: strategy: None status: ...
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 Dev Workspace Operator subscription:
$ oc delete sub devworkspace-operator \ -n openshift-operators 1
- 1
openshift-operators
or an OpenShift project where the Dev Workspace Operator is installed.
Get the Dev Workspace Operator CSVs in the <devworkspace_operator.vX.Y.Z> format:
$ oc get csv | grep devworkspace
Remove each Dev Workspace Operator CSV:
$ oc delete csv <devworkspace_operator.vX.Y.Z> \ -n openshift-operators 1
- 1
openshift-operators
or an OpenShift project where the Dev Workspace Operator is installed.
Re-create the Dev Workspace Operator subscription:
$ cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: devworkspace-operator namespace: openshift-operators spec: channel: fast name: devworkspace-operator source: redhat-operators sourceNamespace: openshift-marketplace installPlanApproval: Automatic 1 startingCSV: devworkspace-operator.v0.21.0 EOF
- 1
Automatic
orManual
.
ImportantFor
installPlanApproval: Manual
, in the Administrator perspective of the OpenShift web console, go toand select the following for the Dev Workspace Operator: . -
In the Administrator perspective of the OpenShift web console, go to
and verify the Succeeded status of the Dev Workspace Operator.