9.2. 升级持久代理部署
此流程演示了如何升级持久代理部署。OpenShift Container Platform 服务目录中的持久代理模板具有类似以下的标签:
- Red Hat AMQ Broker 7.x(Persistence,集群,没有 SSL)
- Red Hat AMQ Broker 7.x(使用 SSL 集群、集群)
- Red Hat AMQ Broker 7.x(使用 SSL 的Persistence)
先决条件
- 从 AMQ Broker 7.3 开始,您可以使用新版本的红帽生态系统目录访问容器镜像。此新版本的注册表要求您成为经过身份验证的用户,然后才能访问镜像并将它们提取到 OpenShift 项目中。在执行本节中的步骤前,您必须首先完成 Red Hat Container Registry 身份验证 中描述的步骤。
步骤
- 导航到 OpenShift Container Platform Web 控制台并登录。
- 点您要升级持久代理部署的项目。
选择与代理部署对应的 StatefulSet(SS)。
-
在 OpenShift Container Platform 4.5 或更高版本中,点
。 -
在 OpenShift Container Platform 3.11 中,点
。
-
在 OpenShift Container Platform 4.5 或更高版本中,点
在 Actions 菜单中,点 Edit StatefulSet (OpenShift Container Platform 4.5 或更高版本)或 Edit YAML (OpenShift Container Platform 3.11)。
StatefulSet 的 YAML 选项卡会打开,在可编辑模式下带有
.yaml文件。要准备您的代理部署进行升级,将部署缩减到零代理。
-
如果
replicas属性目前设置为1或更高,则将其设置为0。 - 点击 Save。
-
如果
-
当所有代理 Pod 都已关闭后,再次编辑 StatefulSet
.yaml文件。编辑image属性,以指定最新的 AMQ Broker 7.8 容器镜像registry.redhat.io/amq7/amq-broker:7.8。 添加
imagePullSecrets属性,以指定与 Red Hat Container Registry 中用于身份验证的帐户关联的镜像 pull secret。基于前两个步骤的更改在以下示例中显示:
... spec: containers: image: 'registry.redhat.io/amq7/amq-broker:7.8' .. imagePullSecrets: - name: {PULL-SECRET-NAME}-
将
replicas属性设置回原始值。 点击 Save。
如果红帽提供了比当前安装的代理镜像更新的代理镜像,OpenShift Container Platform 会升级您的代理部署。要做到这一点,OpenShift Container Platform 重启代理 Pod。