7.7. ホステッドクラスターのコントロールプレーンの更新
Hosted Control Plane でホステッドクラスターを更新することで、OpenShift Container Platform のバージョンをアップグレードできます。HostedCluster
カスタムリソース (CR) の .spec.release
は、コントロールプレーンのバージョンを示します。HostedCluster
は、.spec.release
フィールドを HostedControlPlane.spec.release
に更新し、適切な Control Plane Operator のバージョンを実行します。
HostedControlPlane
リソースは、新しいバージョンの Cluster Version Operator (CVO) により、データプレーン内の OpenShift Container Platform コンポーネントとともに、新しいバージョンのコントロールプレーンコンポーネントのロールアウトを調整します。HostedControlPlane
には次のアーティファクトが含まれています。
- CVO
- Cluster Network Operator (CNO)
- Cluster Ingress Operator
- Kube API サーバー、スケジューラー、およびマネージャーのマニフェスト
- Machine approver
- Autoscaler
- Kube API サーバー、Ignition、Konnectivity など、コントロールプレーンエンドポイントの Ingress を有効にするインフラストラクチャーリソース
HostedCluster
CR の .spec.release
フィールドを設定すると、status.version.availableUpdates
フィールドと status.version.conditionalUpdates
フィールドの情報を使用してコントロールプレーンを更新できます。
手順
次のコマンドを実行して、ホストされたクラスターに
hypershift.openshift.io/force-upgrade-to=<openshift_release_image>
アノテーションを追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc annotate hostedcluster \ -n <hosted_cluster_namespace> <hosted_cluster_name> \ "hypershift.openshift.io/force-upgrade-to=<openshift_release_image>" \ --overwrite
$ oc annotate hostedcluster \ -n <hosted_cluster_namespace> <hosted_cluster_name> \
1 "hypershift.openshift.io/force-upgrade-to=<openshift_release_image>" \
2 --overwrite
- 1
<hosted_cluster_name>
と<hosted_cluster_namespace>
を、それぞれホストされたクラスター名とホストされたクラスター namespace に置き換えます。- 2
<openshift_release_image>
変数は、アップグレードする新しい OpenShift Container Platform リリースイメージを指定します (例:quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64
)。<4.y.z>
をサポートされている OpenShift Container Platform バージョンに置き換えます。
次のコマンドを実行して、ホストされたクラスターの
spec.release.image
値を変更します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc patch hostedcluster <hosted_cluster_name> -n <hosted_cluster_namespace> \ --type=merge \ -p '{"spec":{"release":{"image":"<openshift_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
の値を確認します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get -n <hosted_cluster_namespace> hostedcluster <hosted_cluster_name> \ -o yaml
$ oc get -n <hosted_cluster_namespace> hostedcluster <hosted_cluster_name> \ -o yaml
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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" status: "True" type: ClusterVersionReleaseAccepted #... version: availableUpdates: null desired: image: quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 version: 4.y.z
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