Chapter 3. Installing CodeReady Workspaces

This section contains instructions to install Red Hat CodeReady Workspaces. The installation method depends on the target platform and the environment restrictions.

3.1. Installing CodeReady Workspaces on OpenShift 4 using OperatorHub

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

3.1.1. Creating a project in OpenShift Web Console

A project allows to organize and manage different resources on the cluster in an isolated unit. Create a project first to host the Red Hat CodeReady Workspaces Operator.

Procedure

  1. Open the OpenShift web console, in the left panel navigate to the HomeProjects section.
  2. Click Create Project.
  3. Specify the project details:

    • Name: openshift-workspaces
    • Display Name: Red Hat CodeReady Workspaces
    • Description: Red Hat CodeReady Workspaces

3.1.2. Installing the Red Hat CodeReady Workspaces Operator

Red Hat CodeReady Workspaces Operator provides all the resources for running CodeReady Workspaces, such as PostgreSQL, RH-SSO, image registries, and the CodeReady Workspaces server, and also configures all these services.

Prerequisites

  • Access to the Web Console on the cluster.

Procedure

  1. To install the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the OperatorsOperatorHub section.
  2. In the Filter by keyword field, type Red Hat CodeReady Workspaces and click the Red Hat CodeReady Workspaces tile.
  3. In the Red Hat CodeReady Workspaces pop-up window, click the Install button.
  4. On the Install Operator screen, specify the following options:

    • Installation mode: A specific project on the cluster
    • Installed Namespace: *Pick an existing project → openshift-workspaces

Verification steps

  1. To verify the Red Hat CodeReady Workspaces Operator has installed correctly, in the left panel navigate to the OperatorsInstalled Operators section.
  2. In the Installed Operators screen, click the Red Hat CodeReady Workspaces name and navigate to the Details tab.
  3. 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
  4. Navigate to the Events tab and wait for this message: install strategy completed with no errors.

3.1.3. Creating an instance of the Red Hat CodeReady Workspaces Operator

Follow this procedure to install Red Hat CodeReady Workspaces with the default configuration. To modify the configuration, see Chapter 2, Configuring the CodeReady Workspaces installation.

Procedure

  1. To create an instance of the Red Hat CodeReady Workspaces Operator, in the left panel, navigate to the OperatorsInstalled Operators section.
  2. In the Installed Operators screen, click the Red Hat CodeReady Workspaces name.
  3. In the Operator Details screen, in the Details tab, inside of the Provided APIs section, click the Create Instance link.
  4. The Create CheCluster page contains the configuration of the overall CodeReady Workspaces instance to create. It is the CheCluster Custom Resource. Keep the default values.
  5. To create the codeready-workspaces cluster, click the Create button in the lower left corner of the window.
  6. On the Operator Details screen, in the Red Hat CodeReady Workspaces Cluster tab, click on the codeready-workspaces link.
  7. To navigate to the codeready-workspaces instance, click the link under Red Hat CodeReady Workspaces URL.

    Note

    The installation might take more than 5 minutes. The URL appears after the Red Hat CodeReady Workspaces installation finishes.

Verification steps

  1. To verify that the Red Hat CodeReady Workspaces instance has installed correctly, navigate to the CodeReady Workspaces Cluster tab. The CheClusters screen displays the list of Red Hat CodeReady Workspaces instances and their status.
  2. Click codeready-workspaces CheCluster in the table and navigate to the Details tab.
  3. See 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.
  4. Navigate to the Resources tab. The screen displays the list of the resources assigned to the CodeReady Workspaces deployment.
  5. To see more details about the state of a resource, click its name and inspect the content of the available tabs.

3.2. Installing CodeReady Workspaces on OpenShift 4 using the CLI

This section describes how to install CodeReady Workspaces on OpenShift 4 with the crwctl CLI management tool.

Prerequisites

Procedure

  • Run the server:deploy command to create the CodeReady Workspaces instance:

    $ crwctl server:deploy -n openshift-workspaces

Verification steps

  1. The output of the server:deploy command ends with:

    Command server:deploy has completed successfully.
  2. Navigate to the CodeReady Workspaces cluster instance: \https://codeready-<openshift_deployment_name>.<domain_name>.

3.3. Installing CodeReady Workspaces on OpenShift Container Platform 3.11

3.3.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.8.
  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.

3.3.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).

Note

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

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

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 command to create the CodeReady Workspaces instance

    • In the openshift-workspaces project:

      $ crwctl server:deploy -n openshift-workspaces -p openshift
    • In the default project called openshift-workspaces:

      $ crwctl server:deploy -p openshift

Verification steps

  1. The output of the previous command ends with:

    Command server:deploy has completed successfully.
  2. Navigate to the CodeReady Workspaces cluster instance: \https://codeready-<openshift_deployment_name>.<domain_name>.

3.4. Installing CodeReady Workspaces in a restricted environment

By default, Red Hat CodeReady Workspaces uses various external resources, mainly container images available in public registries.

To deploy CodeReady Workspaces in an environment where these external resources are not available (for example, on a cluster that is not exposed to the public Internet):

  1. Identify the image registry used by the OpenShift cluster, and ensure you can push to it.
  2. Push all the images needed for running CodeReady Workspaces to this registry.
  3. Configure CodeReady Workspaces to use the images that have been pushed to the registry.
  4. Proceed to the CodeReady Workspaces installation.

The procedure for installing CodeReady Workspaces in restricted environments is different based on the installation method you use:

Notes on network connectivity in restricted environments

Restricted network environments range from a private subnet in a cloud provider to a separate network owned by a company, disconnected from the public Internet. Regardless of the network configuration, CodeReady Workspaces works provided that the Routes that are created for CodeReady Workspaces components (codeready-workspaces-server, identity provider, devfile and plugin registries) are accessible from inside the OpenShift cluster.

Take into account the network topology of the environment to determine how best to accomplish this. For example, on a network owned by a company or an organization, the network administrators must ensure that traffic bound from the cluster can be routed to Route hostnames. In other cases, for example, on AWS, create a proxy configuration allowing the traffic to leave the node to reach an external-facing Load Balancer.

When the restricted network involves a proxy, follow the instructions provided in Section 3.4.3, “Preparing CodeReady Workspaces Custom Resource for installing behind a proxy”.

3.4.1. Installing CodeReady Workspaces in a restricted environment using OperatorHub

Prerequisites

On disconnected OpenShift 4 clusters running on restricted networks, an Operator can be successfully installed from OperatorHub only if it meets the additional requirements defined in Enabling your Operator for restricted network environments.

The CodeReady Workspaces operator meets these requirements and is therefore compatible with the official documentation about OLM on a restricted network.

Procedure

To install CodeReady Workspaces from OperatorHub:

  1. Build a redhat-operators catalog image. See Building an Operator catalog image.
  2. Configure OperatorHub to use this catalog image for operator installations. See Configuring OperatorHub for restricted networks.
  3. Proceed to the CodeReady Workspaces installation as usual as described in Section 3.1, “Installing CodeReady Workspaces on OpenShift 4 using OperatorHub”.

3.4.2. Installing CodeReady Workspaces in a restricted environment using CLI management tool

Note

Use CodeReady Workspaces CLI management tool to install CodeReady Workspaces on restricted networks if installation through OperatorHub is not available. This method is supported for OpenShift Container Platform 3.11.

Prerequisites

3.4.2.1. Preparing an private registry

Prerequisites

  • The oc tool is available.
  • The skopeo tool, version 0.1.40 or later, is available.
  • The podman tool is available.
  • An image registry accessible from the OpenShift cluster and supporting the format of the V2 image manifest, schema version 2. Ensure you can push to it from a location having, at least temporarily, access to the internet.

Table 3.1. Placeholders used in examples

<source-image>

Full coordinates of the source image, including registry, organization, and digest.

<target-registry>

Host name and port of the target container-image registry.

<target-organization>

Organization in the target container-image registry

<target-image>

Image name and digest in the target container-image registry.

<target-user>

User name in the target container-image registry.

<target-password>

User password in the target container-image registry.

Procedure

  1. Log into the internal image registry:

    $ podman login --username <user> --password <password> <target-registry>
    Note

    If you encounter an error, like x509: certificate signed by unknown authority, when attempting to push to the internal registry, try one of these workarounds:

    • add the OpenShift cluster’s certificate to /etc/containers/certs.d/<target-registry>
    • add the registry as an insecure registry by adding the following lines to the Podman configuration file located at /etc/containers/registries.conf:
    [registries.insecure]
    registries = ['<target-registry>']
  2. Copy images without changing their digest. Repeat this step for every image in the following table:

    $ skopeo copy --all docker://<source-image> docker://<target-registry>/<target-organization>/<target-image>
    Note

    Table 3.2. Understanding the usage of the container-images from the prefix or keyword they include in their name

    UsagePrefix or keyword

    Essential

    not stacks-, plugin-, or -openj9-

    Workspaces

    stacks-, plugin-

    IBM Z and IBM Power Systems

    -openj9-

    Table 3.3. Images to copy in the private registry

    <source-image><target-image>

    registry.redhat.io/codeready-workspaces/configbump-rhel8@sha256:db34b20374d99c2055612663a669a06f6dd0fc1fc19603761e993fd0870eddfe

    configbump-rhel8@sha256:db34b20374d99c2055612663a669a06f6dd0fc1fc19603761e993fd0870eddfe

    registry.redhat.io/codeready-workspaces/crw-2-rhel8-operator@sha256:a24dc83d8cdd8af715f0c4f235dcba0736bf395b7029ceaed0b8a683da5f74e0

    crw-2-rhel8-operator@sha256:a24dc83d8cdd8af715f0c4f235dcba0736bf395b7029ceaed0b8a683da5f74e0

    registry.redhat.io/codeready-workspaces/crw-2-rhel8-operator@sha256:a24dc83d8cdd8af715f0c4f235dcba0736bf395b7029ceaed0b8a683da5f74e0

    crw-2-rhel8-operator@sha256:a24dc83d8cdd8af715f0c4f235dcba0736bf395b7029ceaed0b8a683da5f74e0

    registry.redhat.io/codeready-workspaces/devfileregistry-rhel8@sha256:e3c360c031d8e68b62d1a28a4d736f41c5bfbc17c23999b9e1f1e5820858bf1d

    devfileregistry-rhel8@sha256:e3c360c031d8e68b62d1a28a4d736f41c5bfbc17c23999b9e1f1e5820858bf1d

    registry.redhat.io/codeready-workspaces/jwtproxy-rhel8@sha256:3f40bb8a2022545ac06a0b41cdb0239fdacfc34b37faffb21348a2041e96d0f2

    jwtproxy-rhel8@sha256:3f40bb8a2022545ac06a0b41cdb0239fdacfc34b37faffb21348a2041e96d0f2

    registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:19a8daf7f9adde981dcd588b0526fa7682111097849f60a9b0e81137bdde8f6c

    machineexec-rhel8@sha256:19a8daf7f9adde981dcd588b0526fa7682111097849f60a9b0e81137bdde8f6c

    registry.redhat.io/codeready-workspaces/plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    registry.redhat.io/codeready-workspaces/plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    registry.redhat.io/codeready-workspaces/plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    plugin-java11-openj9-rhel8@sha256:ee7c41053b4c8615886745566fc306dbf5bd1b1d367e525266477ae17a26673e

    registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:d93195134cef6351b1f9e3165fecc09f464dc99ab33d11b68fadd613d04d1636

    plugin-java11-rhel8@sha256:d93195134cef6351b1f9e3165fecc09f464dc99ab33d11b68fadd613d04d1636

    registry.redhat.io/codeready-workspaces/plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    registry.redhat.io/codeready-workspaces/plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    registry.redhat.io/codeready-workspaces/plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    plugin-java8-openj9-rhel8@sha256:8d8948134405e45bdd895932afa85b6cf0fbfe4e9bb58ae9753d233ddf74672b

    registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:ecaa9ddef5ca8db9552f1b5e66f7aacb19d72e488d718d8135b1e1d9f66a1a7a

    plugin-java8-rhel8@sha256:ecaa9ddef5ca8db9552f1b5e66f7aacb19d72e488d718d8135b1e1d9f66a1a7a

    registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:cf1d0e24f8bae0f87cae0b1577dfd25e124437d78031d7076fabebb2dcf48d7f

    plugin-kubernetes-rhel8@sha256:cf1d0e24f8bae0f87cae0b1577dfd25e124437d78031d7076fabebb2dcf48d7f

    registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:13ce6d8fdeeea0cc5a220ebe8abd2811c31bb2a424736759be9a6df15c8f77fd

    plugin-openshift-rhel8@sha256:13ce6d8fdeeea0cc5a220ebe8abd2811c31bb2a424736759be9a6df15c8f77fd

    registry.redhat.io/codeready-workspaces/pluginbroker-artifacts-rhel8@sha256:cda306cb7e5c42faa6ab43218d39984d4955134b3ca9654968c28b05e0796c3a

    pluginbroker-artifacts-rhel8@sha256:cda306cb7e5c42faa6ab43218d39984d4955134b3ca9654968c28b05e0796c3a

    registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:0143a80b869620af08a0d60165dc9d13357a79e7243502832326cf053c17ee38

    pluginbroker-metadata-rhel8@sha256:0143a80b869620af08a0d60165dc9d13357a79e7243502832326cf053c17ee38

    registry.redhat.io/codeready-workspaces/pluginregistry-rhel8@sha256:3f5163a2303de7f538eca2cc560403f38b920af1169821dfa06dbef695fb10c6

    pluginregistry-rhel8@sha256:3f5163a2303de7f538eca2cc560403f38b920af1169821dfa06dbef695fb10c6

    registry.redhat.io/codeready-workspaces/server-rhel8@sha256:6635e8c160c8c73c00c9b05eccab08a4ff23d344f102ef0097a3798bf108217a

    server-rhel8@sha256:6635e8c160c8c73c00c9b05eccab08a4ff23d344f102ef0097a3798bf108217a

    registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:06cd3600c3b6c3dca0451b10b46961fd0db4140c7dddc4f9637984022f5cfc09

    stacks-cpp-rhel8@sha256:06cd3600c3b6c3dca0451b10b46961fd0db4140c7dddc4f9637984022f5cfc09

    registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:ea77974b206c7d7abcad5cd32149f6bb669d3cf867135553af4d7dddd24ba9cf

    stacks-dotnet-rhel8@sha256:ea77974b206c7d7abcad5cd32149f6bb669d3cf867135553af4d7dddd24ba9cf

    registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:e01d32e58a55a552f0d35b9a6210b7a2cc8ed444f8ae54a24113dcc85f4d80db

    stacks-golang-rhel8@sha256:e01d32e58a55a552f0d35b9a6210b7a2cc8ed444f8ae54a24113dcc85f4d80db

    registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:95c324ed660924bf76e10b461d75aa5be2a323f26e5033239f7cbfe1ec10b26e

    stacks-php-rhel8@sha256:95c324ed660924bf76e10b461d75aa5be2a323f26e5033239f7cbfe1ec10b26e

    registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:60c84fca55a997a6aab4ca07b8ff7d859948c1f525adeba2ae624c84fe059a56

    theia-endpoint-rhel8@sha256:60c84fca55a997a6aab4ca07b8ff7d859948c1f525adeba2ae624c84fe059a56

    registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:de36fdf140ba6367e6edf577d6dbaffa270e5e5ecf0890e498f5907f8287858f

    theia-rhel8@sha256:de36fdf140ba6367e6edf577d6dbaffa270e5e5ecf0890e498f5907f8287858f

    registry.redhat.io/codeready-workspaces/traefik-rhel8@sha256:0698a776c6ae2f08238cf011d69ac2c67f934b1e25ec38701a9e360430fd10f7

    traefik-rhel8@sha256:0698a776c6ae2f08238cf011d69ac2c67f934b1e25ec38701a9e360430fd10f7

    registry.redhat.io/jboss-eap-7/eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    registry.redhat.io/jboss-eap-7/eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    registry.redhat.io/jboss-eap-7/eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    eap-xp2-openj9-11-openshift-rhel8@sha256:95d2ce73a0759de5befdbec115514a555752e2f20070fbfe356801da6d0a2bd6

    registry.redhat.io/jboss-eap-7/eap-xp2-openjdk11-openshift-rhel8@sha256:647d092383a760edc083eafb2d7bc3208d6409097281bedbd5eaccde360e7e39

    eap-xp2-openjdk11-openshift-rhel8@sha256:647d092383a760edc083eafb2d7bc3208d6409097281bedbd5eaccde360e7e39

    registry.redhat.io/jboss-eap-7/eap73-openjdk8-openshift-rhel7@sha256:d16cfe30eaf20a157cd5d5980a6c34f3fcbcfd2fd225e670a0138d81007dd919

    eap73-openjdk8-openshift-rhel7@sha256:d16cfe30eaf20a157cd5d5980a6c34f3fcbcfd2fd225e670a0138d81007dd919

    registry.redhat.io/rh-sso-7/sso74-openj9-openshift-rhel8@sha256:ed11770a85ca95fc9cbb2cade539a67ff0e127cff73a89a017415800e032bd5b

    sso74-openj9-openshift-rhel8@sha256:ed11770a85ca95fc9cbb2cade539a67ff0e127cff73a89a017415800e032bd5b

    registry.redhat.io/rh-sso-7/sso74-openj9-openshift-rhel8@sha256:ed11770a85ca95fc9cbb2cade539a67ff0e127cff73a89a017415800e032bd5b

    sso74-openj9-openshift-rhel8@sha256:ed11770a85ca95fc9cbb2cade539a67ff0e127cff73a89a017415800e032bd5b

    registry.redhat.io/rh-sso-7/sso74-openshift-rhel8@sha256:3154fd4f6ce080260de9d2b4c02930b67b57f1181f4e660f5ddfc9f6050420b1

    sso74-openshift-rhel8@sha256:3154fd4f6ce080260de9d2b4c02930b67b57f1181f4e660f5ddfc9f6050420b1

    registry.redhat.io/rhel8/postgresql-96@sha256:32d73d737acec3daabc3f5c8236588454c8f57f7a2656ac7a50cf3a04f520b9b

    postgresql-96@sha256:32d73d737acec3daabc3f5c8236588454c8f57f7a2656ac7a50cf3a04f520b9b

    registry.redhat.io/rhscl/mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73

    mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73

    registry.redhat.io/ubi8/ubi-minimal@sha256:2f6b88c037c0503da7704bccd3fc73cb76324101af39ad28f16460e7bce98324

    ubi8ubi-minimal@sha256:2f6b88c037c0503da7704bccd3fc73cb76324101af39ad28f16460e7bce98324

Verification steps

  • Verify the images have the same digests:

    $ skopeo inspect docker://<source-image>
    $ skopeo inspect docker://<target-registry>/<target-organization>/<target-image>

Additional resources

3.4.2.2. Preparing CodeReady Workspaces Custom Resource for restricted environment

When installing CodeReady Workspaces in a restricted environment using crwctl or OperatorHub, provide a CheCluster custom resource with additional information.

3.4.2.2.1. Downloading the default CheCluster Custom Resource

Procedure

  1. Download the default custom resource YAML file.
  2. Name the downloaded custom resource org_v1_che_cr.yaml. Keep it for further modification and usage.
3.4.2.2.2. Customizing the CheCluster Custom Resource for restricted environment

Prerequisites

  • All required images available in an image registry that is visible to the OpenShift cluster where CodeReady Workspaces is to be deployed. This is described in Section 3.4.2.1, “Preparing an private registry”, where the placeholders used in the following examples are also defined.

Procedure

  1. In the CheCluster Custom Resource, which is managed by the CodeReady Workspaces Operator, add the fields used to facilitate deploying an instance of CodeReady Workspaces in a restricted environment:

    # [...]
    spec:
      server:
        airGapContainerRegistryHostname: '<target-registry>'
        airGapContainerRegistryOrganization: '<target-organization>'
    # [...]

3.4.2.3. Starting CodeReady Workspaces installation in a restricted environment using CodeReady Workspaces CLI management tool

This sections describes how to start the CodeReady Workspaces installation in a restricted environment using the CodeReady Workspaces CLI management tool.

Prerequisites

Procedure

  1. Log in to OpenShift Container Platform:

    $ oc login ${OPENSHIFT_API_URL} --username ${OPENSHIFT_USERNAME} \
                                    --password ${OPENSHIFT_PASSWORD}
  2. Install CodeReady Workspaces with a customized Custom Resource to add fields related to the restricted environment:

    $ crwctl server:start \
      --che-operator-image=<target-registry>/<target-organization>/crw-2-rhel8-operator:2.8 \
      --che-operator-cr-yaml=org_v1_che_cr.yaml
Note

For slow systems or internet connections, add the --k8spodwaittimeout=1800000 flag option to the crwctl server:start command to extend the Pod timeout period to 1800000 ms or longer.

3.4.3. Preparing CodeReady Workspaces Custom Resource for installing behind a proxy

This procedure describes how to provide necessary additional information to the CheCluster custom resource when installing CodeReady Workspaces behind a proxy.

Procedure

  1. In the CheCluster Custom Resource, which is managed by the CodeReady Workspaces Operator, add the fields used to facilitate deploying an instance of CodeReady Workspaces in a restricted environment:

    # [...]
    spec:
      server:
        proxyURL: '<URL of the proxy, with the http protocol, and without the port>'
        proxyPort: '<Port of proxy, typically 3128>'
    # [...]
  2. In addition to those basic settings, the proxy configuration usually requires adding the host of the external OpenShift cluster API URL in the list of the hosts to be accessed from CodeReady Workspaces without using the proxy.

    To retrieve this cluster API host, run the following command against the OpenShift cluster:

    $ oc whoami --show-server | sed 's#https://##' | sed 's#:.*$##'

    The corresponding field of the CheCluster Custom Resource is nonProxyHosts. If a host already exists in this field, use | as a delimiter to add the cluster API host:

    # [...]
    spec:
      server:
        nonProxyHosts: 'anotherExistingHost|<cluster api host>'
    # [...]