Chapter 6. Upgrading CodeReady Workspaces

CodeReady Workspaces 1.1.0 introduces an operator that uses a controller to watch custom resources. There is no direct upgrade path from CodeReady Workspaces 1.0.1 to CodeReady Workspaces 1.1.0. If you do not have any important workspaces and projects in an existing 1.0.1 namespace, we recommend deleting the 1.0.1 installation and deploying CodeReady Workspaces 1.1.0.

To keep data from an existing 1.0.1 installation, it is possible to upgrade by deploying the new operator to an existing namespace. You can use the manual or the script-based method to upgrade.

6.1. Upgrading CodeReady Workspaces manually

Prerequisites

  • A running instance of Red Hat OpenShift Container Platform 3.11 or OpenShift Dedicated 3.11.
  • The user is logged in to the OpenShift instance (using, for example, oc login).

Procedure

  1. Obtain the current PostgreSQL password (POSTGRESQL_PASSWORD) from the existing PostgreSQL deployment environment, or run the following oc command:

    $ oc get deployment postgres --output=jsonpath= \
    {'.spec.template.spec.containers[0].env \
    [?(@.name=="POSTGRESQL_PASSWORD")].value'} --namespace=<codeready>
    Important

    Substitute <codeready> for the namespace that you are using.

  2. Obtain the current Red Hat SSO administrator username and password (SSO_ADMIN_USERNAME and SSO_ADMIN_PASSWORD) from the existing Red Hat SSO deployment environment, or run the following oc commands:

    $ oc get deployment keycloak --output=jsonpath= \
    {'.spec.template.spec.containers[0].env \
    [?(@.name=="SSO_ADMIN_USERNAME")].value'} --namespace=<codeready>
    
    $ oc get deployment keycloak --output=jsonpath= \
    {'.spec.template.spec.containers[0].env \
    [?(@.name=="SSO_ADMIN_PASSWORD")].value'} --namespace=<codeready>
    Note
    • If you have changed the Red Hat SSO administrator password, provide the new password instead of fetching it from the environment variables.
    • Substitute <codeready> for the namespace that you are using.
  3. Replace the following values in the custom-resource.yaml file with the values you have obtained:

      spec:
        database:
          chePostgresPassword: '<password>'
        auth:
          keycloakAdminUserName: '<username>'
          keycloakAdminPassword: '<password>'
  4. If you have configured OpenShift oAuth, obtain the oAuth secret and set its value in the custom-resource.yaml file:

    1. To obtain the secret, run the following command as the cluster administrator:

      $ oc get oauthclient openshift-identity-provider-h2fh \
      -o=jsonpath= {'.secret'}
    2. Add the following fields to the spec.auth section of the custom-resource.yaml file. Set oAuthClientName to openshift-identity-provider-h2fh if not already set.

        spec:
          auth:
            oAuthClientName: 'openshift-identity-provider-h2fh'
            oAuthSecret: '<secret>'
      Important

      Substitute <secret> for an actual secret.

  5. To deploy the operator to an existing namespace, run the deployment script with the arguments that suit your installation. See Section 2.2, “Running the CodeReady Workspaces deployment script” for detailed instructions.

    $ ./deploy.sh --deploy

6.2. Upgrading CodeReady Workspaces using a migration script

The upgrade process using the migrate.sh script is an automation of the manual steps listed in the preceding manual section.

Prerequisites

  • A running instance of Red Hat OpenShift Container Platform 3.11 or OpenShift Dedicated 3.11.
  • The user is logged in to the OpenShift instance (using, for example, oc login).

Procedure

  1. Run the migrate.sh script with the name of your existing deployed project:

    $ ./migrate.sh --project=codeready

    In the above command, substitute codeready for the name of the OpenShift project that you used for deploying the previous version of CodeReady Workspaces.

  2. Check changes in the custom-resource.yaml file.
  3. Run the deploy.sh script with parameters for your environment. See Section 2.2, “Running the CodeReady Workspaces deployment script” for detailed instructions.