Chapter 2. Installing CodeReady Workspaces on OpenShift Container Platform
2.1. Installing CodeReady Workspaces using the CodeReady Workspaces Operator in OpenShift 4 web console
This section describes how to install CodeReady Workspaces using the CodeReady Workspaces Operator available in OpenShift 4 web console.
Operators are a method of packaging, deploying, and managing a OpenShift application which also provide the following:
- Repeatability of installation and upgrade.
- Constant health checks of every system component.
- Over-the-air (OTA) updates for OpenShift components and independent software vendor (ISV) content.
- A place to encapsulate knowledge from field engineers and spread it to all users.
Prerequisites
- An administrator account on a running instance of OpenShift 4.
Procedure
- Open the OpenShift web console.
-
To create the
Red Hat CodeReady Workspaces
project, in the left panel, navigate to the HomeProjects section. - Click the button.
In the Create Project pop-up window, enter the project details and validate.
-
Name:
CodeReady Workspaces
. -
Display Name:
Red Hat CodeReady Workspaces
. -
Description:
Red Hat CodeReady Workspaces
.
-
Name:
-
To install the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the Operators
OperatorHub section. -
In the Filter by keyword field, type
Red Hat CodeReady Workspaces
. - Click the Red Hat CodeReady Workspaces tile.
- In the Red Hat CodeReady Workspaces pop-up window, click the button .
On the Install Operator screen, choose following options and validate:
- Installation mode: A specific project on the cluster.
-
Installed Namespace:
CodeReady Workspaces
.
-
To create an instance of the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the Operators
Installed Operators section. - In the Installed Operators screen, click the Red Hat CodeReady Workspaces name.
- In the Operator Details screen, in the Details tab, inside of the Provided APIs section, click the Create Instance link.
-
The Create CheCluster page contains the configuration of the overall CodeReady Workspaces instance to create. It is the
CheCluster
Custom Resource. For an installation using the default configuration, keep the default values. To modify the configuration, see Configuring the CodeReady Workspaces installation. - To create the codeready-workspaces cluster, click the button in the lower left corner of the window.
- On the Operator Details screen, in the Red Hat CodeReady Workspaces Cluster tab, click on the codeready-workspaces link.
- To navigate to the codeready-workspaces instance, click the link under Red Hat CodeReady Workspaces URL.
Validation steps
-
To validate the installation of the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the Operators
Installed Operators section. - In the Installed Operators screen, click on the Red Hat CodeReady Workspaces name.
- Navigate to the Details tab.
In the ClusterServiceVersion Details section at the bottom of the page, wait for these messages:
-
Status:
Succeeded
. -
Status Reason:
install strategy completed with no errors
.
-
Status:
- Navigate to the Events tab.
-
Wait for this message:
install strategy completed with no errors
. - To validate the installation of the Red Hat CodeReady Workspaces instance, navigate to the CodeReady Workspaces Cluster tab.
- The CheClusters screen displays the list of Red Hat CodeReady Workspaces instances and their status.
-
Click codeready-workspaces
CheCluster
in the table. - Navigate to the Details tab.
Watch the content of following fields:
-
Message: the field contains error messages, if any. The expected content is
None
. - Red Hat CodeReady Workspaces URL: displays the URL of the Red Hat CodeReady Workspaces instance, once the deployment is successful. An empty field means the deployment has not succeeded.
-
Message: the field contains error messages, if any. The expected content is
- Navigate to the Resources tab.
- The screen displays the list of the resources assigned to the CodeReady Workspaces deployment.
- To see more details about the state of a resource, click its name and inspect the content of the available tabs.
Additional resources
- the CodeReady Workspaces 2.3 End-user Guide.
- the CodeReady Workspaces 2.3 Administration Guide.
-
It is possible to use the
crwctl
utility script for deploying CodeReady Workspaces on OpenShift Container Platform and OpenShift Dedicated versions 4.5. This method is unofficial and serves as a backup installation method for situations where the installation method using OperatorHub is not available. See the Installing CodeReady Workspaces on OpenShift 3 using the Operator section.
2.2. Installing CodeReady Workspaces using the CLI management tool on OpenShift Container Platform 3.11
2.2.1. Installing the crwctl CLI management tool
This section describes how to install crwctl, the CodeReady Workspaces CLI management tool.
Procedure
- Navigate to https://developers.redhat.com/products/codeready-workspaces/download.
- Download the CodeReady Workspaces CLI management tool archive for version 2.3.
-
Extract the archive to a folder, such as
${HOME}/crwctl
or/opt/crwctl
. -
Run the
crwctl
executable from the extracted folder. In this example,${HOME}/crwctl/bin/crwctl version
. -
Optionally, add the
bin
folder to your$PATH
, for example,PATH=${PATH}:${HOME}/crwctl/bin
to enable runningcrwctl
without the full path specification.
Verification step
Running crwctl version
displays the current version of the tool.
2.2.2. Installing CodeReady Workspaces on OpenShift 3 using the Operator
This section describes how to install CodeReady Workspaces on OpenShift 3 with the crwctl
CLI management tool. The method of installation is using the Operator and enable TLS (HTTPS).
Methods for updating from a previous CodeReady Workspaces installation and enabling multiple instances in the same OpenShift Container Platform 3.11 cluster are provided below the installation procedure.
Operators are a method of packaging, deploying, and managing a OpenShift application which also provide the following:
- Repeatability of installation and upgrade.
- Constant health checks of every system component.
- Over-the-air (OTA) updates for OpenShift components and independent software vendor (ISV) content.
- A place to encapsulate knowledge from field engineers and spread it to all users.
This approach is only supported for use with OpenShift Container Platform and OpenShift Dedicated version 3.11, but also work for newer versions of OpenShift Container Platform and OpenShift Dedicated, and serves as a backup installation method for situations when the installation method using OperatorHub is not available.
Prerequisites
- Administrator rights on a running instance of OpenShift 3.11.
-
An installation of the
oc
OpenShift 3.11 CLI management tool. See Installing the OpenShift 3.11 CLI. -
An installation of the
crwctl
management tool. See Using thecrwctl
management tool. -
To apply settings that the main crwctl command-line parameters cannot set, prepare a configuration file
operator-cr-patch.yaml
that will override the default values in theCheCluster
Custom Resource used by the Operator. See Configuring the CodeReady Workspaces installation. - <namespace> represents the project of the target installation.
Procedure
Log in to OpenShift. See Basic Setup and Login.
$ oc login
Run the following command to verify that the version of the
oc
OpenShift CLI management tool is 3.11:$ oc version oc v3.11.0+0cbc58b
Run the following command to create the CodeReady Workspaces instance
In the user-defined <namespace>:
$ crwctl server:start -n <namespace> -p openshift
In the default project called workspaces:
$ crwctl server:start -p openshift
Verification steps
The output of the previous command ends with:
Command server:start has completed successfully.
-
Navigate to the CodeReady Workspaces cluster instance:
https://codeready-<openshift_deployment_name>.<domain_name>
. The domain uses Let’s Encrypt ACME certificates.
Upgrading from a previous CodeReady Workspaces installation
To upgrade from a previous CodeReady Workspaces installation in the same OpenShift Container Platform 3.11 cluster, remove the Custom Resource Definition and the Cluster Roles:
$ oc delete customresourcedefinition/checlusters.org.eclipse.che $ oc patch customresourcedefinition/checlusters.org.eclipse.che \ --type merge \ -p '{ "metadata": { "finalizers": null }}' $ oc delete clusterrole codeready-operator
Having multiple CodeReady Workspaces deployments
To have multiple CodeReady Workspaces deployments in parallel using different versions in the same OpenShift Container Platform 3.11 cluster, create a new service account for the new deployment. It is, however, strongly recommended that you update all your old CodeReady Workspaces deployments to the latest version instead, as this mix of versions may cause unexpected and unsupported results.
$ oc patch clusterrolebinding codeready-operator \ --type='json' \ -p '[{"op": "add", "path": "/subjects/0", "value": {"kind":"ServiceAccount", "namespace": "<workspaces>", "name": "codeready-operator"} }]'