6.5. 为托管的 control plane 更新托管集群
在托管的 control plane 上,您可以通过更新托管集群来升级 OpenShift Container Platform 的版本。
流程
输入以下命令将
hypershift.openshift.io/force-upgrade-to=<openshift_release_image>
注解添加到托管集群:$ oc annotate hostedcluster -n <hosted_cluster_namespace> <hosted_cluster_name> "hypershift.openshift.io/force-upgrade-to=<openshift_release_image>" --overwrite 1 2
输入以下命令更改托管的集群中的
spec.release.image
值:$ oc patch hostedcluster <hosted_cluster_name> -n <hosted_cluster_namespace> --type=merge -p '{"spec":{"release":{"image":"<openshift_release_image>"}}}'
验证
要验证新版本是否已推出,请运行以下命令检查托管的集群中的
.status.conditions
和.status.version
值:$ oc get -n <hosted_cluster_namespace> hostedcluster <hosted_cluster_name> -o yaml
输出示例
status: conditions: - lastTransitionTime: "2024-05-20T15:01:01Z" message: Payload loaded version="4.y.z" image="quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64" 1 status: "True" type: ClusterVersionReleaseAccepted #... version: availableUpdates: null desired: image: quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 2 version: 4.y.z