Skip to content

Commit d824edb

Browse files
Merge pull request #75715 from xenolinux/simplify-upgrade-scenarios
OSDOCS#10239: Simplify upgrading scenarios for hosted control planes
2 parents c5dc8dc + 66fd9b4 commit d824edb

File tree

4 files changed

+90
-7
lines changed

4 files changed

+90
-7
lines changed

hosted_control_planes/hcp-updating.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ toc::[]
88

99
Updates for {hcp} involve updating the hosted cluster and the node pools. For a cluster to remain fully operational during an update process, you must meet the requirements of the link:https://kubernetes.io/releases/version-skew-policy/[Kubernetes version skew policy] while completing the control plane and node updates.
1010

11+
include::modules/hcp-updating-requirements.adoc[leveloffset=+1]
12+
13+
[role="_additional-resources"]
14+
.Additional resources
15+
* xref:../updating/updating_a_cluster/updating-cluster-web-console.adoc#updating-cluster-web-console[Updating a cluster using the web console]
16+
* xref:../updating/updating_a_cluster/updating-cluster-cli.adoc#updating-cluster-cli[Updating a cluster using the CLI]
17+
* xref:../operators/admin/olm-upgrading-operators.adoc#olm-upgrading-operators[Updating installed Operators]
18+
1119
// Updates for the hosted cluster
1220
include::modules/hcp-updates-hosted-cluster.adoc[leveloffset=+1]
1321

@@ -16,3 +24,6 @@ include::modules/hcp-updates-node-pools.adoc[leveloffset=+1]
1624

1725
// Updating node pools for hosted control planes
1826
include::modules/updating-node-pools-for-hcp.adoc[leveloffset=+1]
27+
28+
// Updating a hosted cluster
29+
include::modules/updating-hosted-cluster.adoc[leveloffset=+1]

modules/hcp-updating-requirements.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
[id="hosted-control-planes-upgrading-requirements_{context}"]
77
= Requirements to upgrade {hcp}
88

9-
The multicluster engine for Kubernetes operator can manage one or more {product-title} clusters. After you create a hosted cluster on {product-title}, you must import your hosted cluster in the multicluster engine for Kubernetes operator as a managed cluster. Then, you can use the {product-title} cluster as a management cluster.
9+
The multicluster engine for Kubernetes operator can manage one or more {product-title} clusters. After you create a hosted cluster on {product-title}, you must import your hosted cluster in the multicluster engine operator as a managed cluster. Then, you can use the {product-title} cluster as a management cluster.
1010

1111
Consider the following requirements before you start updating {hcp}:
1212

1313
* You must use the bare metal platform for an {product-title} cluster when using {VirtProductName} as a provider.
1414
15-
* You must use bare metal or {VirtProductName} as the cloud platform for the hosted cluster. You can find the platform type of your hosted cluster in the `spec.Platform.type` specification of the `HostedCluster` custom resource(CR).
15+
* You must use bare metal or {VirtProductName} as the cloud platform for the hosted cluster. You can find the platform type of your hosted cluster in the `spec.Platform.type` specification of the `HostedCluster` custom resource (CR).
1616
1717
You must upgrade the {product-title} cluster, multicluster engine for Kubernetes operator, hosted cluster, and node pools by completing the following tasks:
1818

modules/updating-hosted-cluster.adoc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * upgrades/updating_a_cluster/updating-hosted-control-planes.adoc
4+
// * hosted_control_planes/hcp-updating.adoc
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="updating-hosted-cluster_{context}"]
8+
= Updating the hosted cluster for {hcp}
9+
10+
On {hcp}, you can upgrade your version of {product-title} by updating the hosted cluster.
11+
12+
.Procedure
13+
14+
. Add the `hypershift.openshift.io/force-upgrade-to=<openshift_release_image>` annotation to the hosted cluster by entering the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc annotate hostedcluster -n <hosted_cluster_namespace> <hosted_cluster_name> "hypershift.openshift.io/force-upgrade-to=<openshift_release_image>" --overwrite <1> <2>
19+
----
20+
+
21+
<1> Replace `<hosted_cluster_name>` and `<hosted_cluster_namespace>` with your hosted cluster name and hosted cluster namespace, respectively.
22+
<2> The `<openshift_release_image>` variable specifies the new {product-title} release image that you want to upgrade to.
23+
24+
25+
. Change the `spec.release.image` value in the hosted cluster by entering the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc patch hostedcluster <hosted_cluster_name> -n <hosted_cluster_namespace> --type=merge -p '{"spec":{"release":{"image":"<openshift_release_image>"}}}'
30+
----
31+
32+
33+
.Verification
34+
35+
* To verify that the new version was rolled out, check the `.status.conditions` and `.status.version` values in the hosted cluster by running the following command:
36+
+
37+
[source,terminal]
38+
----
39+
$ oc get -n <hosted_cluster_namespace> hostedcluster <hosted_cluster_name> -o yaml
40+
----
41+
+
42+
.Example output
43+
[source,yaml]
44+
----
45+
status:
46+
conditions:
47+
- lastTransitionTime: "2024-05-20T15:01:01Z"
48+
message: Payload loaded version="4.15.14" image="quay.io/openshift-release-dev/ocp-release:4.15.14-x86_64"
49+
status: "True"
50+
type: ClusterVersionReleaseAccepted
51+
#...
52+
version:
53+
availableUpdates: null
54+
desired:
55+
   image: quay.io/openshift-release-dev/ocp-release:4.15.14-x86_64
56+
   version: 4.15.14
57+
----

modules/updating-node-pools-for-hcp.adoc

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,37 @@
77
[id="updating-node-pools-for-hcp_{context}"]
88
= Updating node pools for {hcp}
99

10-
On {hcp}, you update your version of {product-title} by updating the node pools. The node pool version must not surpass the hosted control plane version.
10+
On {hcp}, you can update your version of {product-title} by updating the node pools. The node pool version must not surpass the hosted control plane version.
1111

1212
.Procedure
1313

14-
* To start the process to update to a new version of {product-title}, change the `spec.release.image` value of the node pool by entering the following command:
14+
* Change the `spec.release.image` value in the node pool by entering the following command:
1515
+
1616
[source,terminal]
1717
----
18-
$ oc -n <hosted_cluster_namespace> patch hostedcluster <hosted_cluster_name> --patch '{"spec":{"release":{"image": "<image_name>"}}}' --type=merge
18+
$ oc patch nodepool <node_pool_name> -n <hosted_cluster_namespace> --type=merge -p '{"spec":{"nodeDrainTimeout":"60s","release":{"image":"<openshift_release_image>"}}}' <1> <2>
1919
----
20+
+
21+
<1> Replace `<node_pool_name>` and `<hosted_cluster_namespace>` with your node pool name and hosted cluster namespace, respectively.
22+
<2> The `<openshift_release_image>` variable specifies the new {product-title} release image that you want to upgrade to.
2023
2124
.Verification
2225

23-
* To verify that the new version was rolled out, check the `.status.version` and `.status.conditions` values in the `HostedCluster` custom resource (CR) by running the following command:
26+
* To verify that the new version was rolled out, check the `.status.conditions` value in the node pool by running the following command:
2427
+
2528
[source,terminal]
2629
----
27-
$ oc get hostedcluster <hosted_cluster_name> -o yaml
30+
$ oc get -n <hosted_cluster_namespace> nodepool <node_pool_name> -o yaml
31+
----
32+
+
33+
.Example output
34+
[source,yaml]
35+
----
36+
status:
37+
conditions:
38+
- lastTransitionTime: "2024-05-20T15:00:40Z"
39+
message: 'Using release image: quay.io/openshift-release-dev/ocp-release:4.15.14-x86_64'
40+
reason: AsExpected
41+
status: "True"
42+
type: ValidReleaseImage
2843
----

0 commit comments

Comments
 (0)