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

  1. Open the OpenShift web console.
  2. To create the Red Hat CodeReady Workspaces project, in the left panel, navigate to the HomeProjects section.
  3. Click the Create Project button.
  4. 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.
  5. To install the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the OperatorsOperatorHub section.
  6. In the Filter by keyword field, type Red Hat CodeReady Workspaces.
  7. Click the Red Hat CodeReady Workspaces tile.
  8. In the Red Hat CodeReady Workspaces pop-up window, click the Install button .
  9. On the Install Operator screen, choose following options and validate:

    • Installation mode: A specific project on the cluster.
    • Installed Namespace: CodeReady Workspaces.
  10. To create an instance of the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the OperatorsInstalled Operators section.
  11. In the Installed Operators screen, click the Red Hat CodeReady Workspaces name.
  12. In the Operator Details screen, in the Details tab, inside of the Provided APIs section, click the Create Instance link.
  13. 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.
  14. To create the codeready-workspaces cluster, click the Create button in the lower left corner of the window.
  15. On the Operator Details screen, in the Red Hat CodeReady Workspaces Cluster tab, click on the codeready-workspaces link.
  16. To navigate to the codeready-workspaces instance, click the link under Red Hat CodeReady Workspaces URL.

Validation steps

  1. To validate the installation of the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the OperatorsInstalled Operators section.
  2. In the Installed Operators screen, click on the Red Hat CodeReady Workspaces name.
  3. Navigate to the Details tab.
  4. 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.
  5. Navigate to the Events tab.
  6. Wait for this message: install strategy completed with no errors.
  7. To validate the installation of the Red Hat CodeReady Workspaces instance, navigate to the CodeReady Workspaces Cluster tab.
  8. The CheClusters screen displays the list of Red Hat CodeReady Workspaces instances and their status.
  9. Click codeready-workspaces CheCluster in the table.
  10. Navigate to the Details tab.
  11. 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.
  12. Navigate to the Resources tab.
  13. The screen displays the list of the resources assigned to the CodeReady Workspaces deployment.
  14. To see more details about the state of a resource, click its name and inspect the content of the available tabs.

Additional resources

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

  1. Navigate to https://developers.redhat.com/products/codeready-workspaces/download.
  2. Download the CodeReady Workspaces CLI management tool archive for version 2.2.
  3. Extract the archive to a folder, such as ${HOME}/crwctl or /opt/crwctl.
  4. Run the crwctl executable from the extracted folder. In this example, ${HOME}/crwctl/bin/crwctl version.
  5. Optionally, add the bin folder to your $PATH, for example, PATH=${PATH}:${HOME}/crwctl/bin to enable running crwctl 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).

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.
Tip

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 the crwctl 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 the CheCluster Custom Resource used by the Operator. See Configuring the CodeReady Workspaces installation.
  • <workspaces> represents the project of the target installation.

Procedure

  1. Log in to OpenShift. See Basic Setup and Login.

    $ oc login
  2. 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
  3. Run the following commands to create a dummy project to find the URL that this OpenShift instance is using to deploy applications.

    $ oc new-project hello-world
    $ oc new-app centos/httpd-24-centos7~https://github.com/openshift/httpd-ex
    $ oc expose svc/httpd-ex
    $ oc get route httpd-ex
    NAME     HOST/PORT                                                PATH     SERVICES PORT     TERMINATION WILDCARD
    httpd-ex httpd-ex-hello-world.apps.rhpds311.openshift.opentlc.com httpd-ex          8080-tcp             None
  4. Extract the domain from httpd-ex-hello-world.apps.rhpds311.openshift.opentlc.com. It is the part after the first name: apps.rhpds311.openshift.opentlc.com. Remember this URL as <OPENSHIFT_APPS_URL>.
  5. Remove the dummy project:

    $ oc delete project hello-world
  6. 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
  7. 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"} }]'
  8. Run the following command to create the CodeReady Workspaces instance:

    $ crwctl server:start -n <workspaces> --che-operator-cr-patch-yaml=operator-cr-patch.yaml

Verification steps

  1. The output of the previous command ends with:

    Command server:start has completed successfully.
  2. Navigate to the CodeReady Workspaces cluster instance: https://codeready-<openshift_deployment_name>.<domain_name>. The domain uses Let’s Encrypt ACME certificates.