5.2. 在 Red Hat OpenShift 上升级 CodeReady Workspaces 2.15

CodeReady Workspaces 2.15 和更早的版本中使用的工作区引擎和验证系统已弃用。因此,升级 CodeReady Workspaces 2.15 涉及运行升级脚本。

5.2.1. 在 Red Hat OpenShift 上手动将 CodeReady Workspaces 2.15 升级到 OpenShift Dev Spaces 3.0.1

您可以在 Red Hat OpenShift 上手动将 CodeReady Workspaces 2.15 手动升级到 OpenShift Dev Spaces 3.0.1。

先决条件

  • OpenShift Container Platform 4.10 或 OpenShift Dedicated 4.10 或 Red Hat OpenShift Service on AWS(ROSA)4.10。
  • 在其中一个 第 1.1 节 “支持的平台” 上部署的 CodeReady Workspaces 实例。该实例使用默认的内部 PostgreSQL 数据库,并在 Red Hat OpenShift 上启用了 OAuth。请参阅 Red Hat CodeReady Workspaces 2.15 - 配置 OpenShift OAuth
  • 可用的命令行工具如下:

    • oc
    • curl
    • jq
  • 运行升级命令的主机在 Linux 上运行。
  • 可选:

    1. 所有工作区中的所有更改都已提交并推送到其 Git 远程。
    2. 所有工作区都已停止,以避免 UX 降级。
    3. CodeReady Workspaces 数据已被备份。请参阅 Red Hat CodeReady Workspaces 2.15 - 备份和恢复

流程

  1. 下载 1-prepare.sh

    1-prepare.sh 关闭 CodeReady Workspaces 和 RH-SSO,获取现有用户的数据,转储 CodeReady Workspaces 数据库。

  2. 下载 2 个迁移.sh

    2-migrate.sh 获取 CodeReady Workspaces RH-SSO 和数据库数据,并使用更新的数据提供数据库。

  3. 下载 3 个订阅.sh.

    3subscribe.sh 删除 CodeReady Workspaces Operator 和 RH-SSO 资源,更新 CheCluster CR,并创建一个新的 OpenShift Dev Spaces Operator 订阅。

  4. 下载 4-wait.sh.

    4-wait.sh 会等待到 OpenShift Dev Spaces 就绪,这可能需要超过 5 分钟。

  5. 设置升级脚本中使用的环境变量:

    export INSTALLATION_NAMESPACE=openshift-workspaces 1
    export PRODUCT_ID=red-hat-openshift-devspaces
    export PRODUCT_DEPLOYMENT_NAME=devspaces
    export PRODUCT_OPERATOR_NAME=devspaces-operator
    export PRODUCT_OLM_STABLE_CHANNEL=stable
    export PRODUCT_OLM_CATALOG_SOURCE=redhat-operators
    export PRODUCT_OLM_PACKAGE=devspaces
    export PRODUCT_OLM_STARTING_CSV=devspacesoperator.v3.0.1
    export PRE_MIGRATION_PRODUCT_OPERATOR_NAMESPACE=openshift-workspaces 2
    export PRE_MIGRATION_PRODUCT_SHORT_ID=codeready
    export PRE_MIGRATION_PRODUCT_DEPLOYMENT_NAME=codeready
    export PRE_MIGRATION_PRODUCT_OPERATOR_NAME=codeready-operator
    export PRE_MIGRATION_PRODUCT_CHE_CLUSTER_CR_NAME=codeready-workspaces
    export PRE_MIGRATION_PRODUCT_IDENTITY_PROVIDER_DEPLOYMENT_NAME=keycloak
    export PRE_MIGRATION_PRODUCT_SUBSCRIPTION_NAME=codeready-workspaces
    1
    以前安装了 CodeReady Workspaces 的 OpenShift -workspaces 或另一个项目。
    2
    以前安装了 CodeReady Workspaces 的 OpenShift -workspaces 或另一个项目。
  6. 运行升级脚本:

    $ chmod +x ./1-prepare.sh ./2-migrate.sh ./3-subscribe.sh ./4-wait.sh; \
      ./1-prepare.sh && ./2-migrate.sh && ./3-subscribe.sh && ./4-wait.sh

验证

  • 在 OpenShift Dev Spaces 仪表板中,进入 AboutServer Version 以验证它是否为 3.0