Skip to content

Commit 4c5e606

Browse files
authored
Merge pull request #100935 from openshift-cherrypick-robot/cherry-pick-100445-to-enterprise-4.20
[enterprise-4.20] OSDOCS-14809: Capacity Reservations in ROSA HCP
2 parents 52d04c7 + 52255bc commit 4c5e606

File tree

5 files changed

+167
-2
lines changed

5 files changed

+167
-2
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="creating_machine_pools_cli_capres_{context}"]
7+
= Creating a machine pool with Capacity Reservations using the {rosa-cli}
8+
9+
You can create a new machine pool with Capacity Reservations by using the {rosa-cli-first}. Both On-Demand Capacity Reservations and Capacity Blocks for ML are supported.
10+
11+
[NOTE]
12+
====
13+
Currently, upgrading machine pools and enabling autoscaling is not suppored on machine pools with Capacity Reservations.
14+
====
15+
16+
.Prerequisites
17+
18+
* You installed and configured the {rosa-cli} version 1.2.57 or above.
19+
* You logged in to your Red{nbsp}Hat account using the {rosa-cli}.
20+
* You created a {product-title} cluster version 4.19 or above.
21+
* The cluster already has a machine pool that is not using a Capacity Reservation or taints. The machine pool must have at least 2 worker nodes.
22+
* You have a Capacity Reservation ID and capacity is reserved for the instance type required in the Availability Zone (AZ) of the machine pool that you are creating.
23+
24+
.Procedure
25+
26+
* Create the machine pool and define the instance type, worker node count, and Capacity Reservation ID by running the following command:
27+
+
28+
--
29+
[source,terminal]
30+
----
31+
$ rosa create machinepool --cluster=<cluster-name> \
32+
--name=<machine_pool_id> \
33+
--replicas=<replica_count> \
34+
--capacity-reservation-id cr-<capacity_reservation_id> \
35+
--instance-type=<instance_type> \
36+
--subnet <subnet_id>
37+
----
38+
39+
where:
40+
41+
*<machine_pool_id>*:: Specifies the name of the machine pool.
42+
*<replica_count>*:: Specifies the number of provisioned compute nodes. If you deploy {product-title} using a single AZ, this defines the number of compute nodes provisioned to the machine pool for the AZ. If you deploy your cluster using multiple AZs, this defines the total number of compute nodes provisioned across all AZs. For multi-zone clusters, the compute node count must be a multiple of 3. The `--replicas` argument is required when autoscaling is not configured.
43+
*cr-<capacity_reservation_id>*:: Specifies the reservation ID. You get an ID in the `cr-<capacity_reservation_id>` format when you purchase a Capacity Reservation from AWS. The ID can be for both On-Demand Capacity Reservations or Capacity Blocks for ML, you do not need to specify the reservation type.
44+
*<instance_type>*:: *Optional*: Specifies the instance type for the compute nodes in your machine pool. The instance type defines the vCPU and memory allocation for each compute node in the pool. Replace `<instance_type>` with an instance type. The default is `m5.xlarge`. You cannot change the instance type for a machine pool after the pool is created.
45+
*<subnet_id>*:: *Optional*: Specifies the subnet ID. For Bring Your Own Virtual Private Cloud (BYO VPC) clusters, you can select a subnet to create a single-AZ machine pool. If you select a subnet that was not specified during the initial cluster creation, you must tag the subnet with the `kubernetes.io/cluster/<infra-id>` key and `shared` value. Customers can obtain the Infra ID by running the following command:
46+
+
47+
[source,terminal]
48+
----
49+
$ rosa describe cluster --cluster <cluster_name>|grep "Infra ID:"
50+
----
51+
+
52+
.Example output
53+
[source,terminal]
54+
----
55+
Infra ID: mycluster-xqvj7
56+
----
57+
--
58+
59+
.Example
60+
61+
The following example creates a machine pool called `mymachinepool` that uses the `c5.xlarge` instance type and has 1 compute node replica. The example also adds a Capacity Reservation ID. Example input and output:
62+
63+
[source,terminal]
64+
----
65+
$ rosa create machinepool --cluster=mycluster --name=mymachinepool --replicas 1 --capacity-reservation-id <capacity_reservation_id> --subnet <subnet_id> --instance-type c5.xlarge
66+
----
67+
68+
[source,terminal]
69+
----
70+
I: Checking available instance types for machine pool 'mymachinepool'
71+
I: Machine pool 'mymachinepool' created successfully on hosted cluster 'mycluster'
72+
----
73+
74+
.Verification
75+
76+
You can list all machine pools on your cluster or describe individual machine pools.
77+
78+
* List the available machine pools on your cluster by running the following command:
79+
+
80+
[source,terminal]
81+
----
82+
$ rosa list machinepools --cluster <cluster_name>
83+
----
84+
85+
* Describe the information of a specific machine pool in your cluster by running the following command.
86+
+
87+
[source,terminal]
88+
----
89+
$ rosa describe machinepool --cluster <cluster_name> --machinepool <machine_pool_name>
90+
----
91+
+
92+
.Example output
93+
[source,terminal]
94+
----
95+
ID: <machine_pool_name>
96+
Cluster ID: <cluster-id>
97+
Autoscaling: No
98+
Desired replicas: 1
99+
Current replicas: 1
100+
Instance type: c5.xlarge
101+
Labels:
102+
Tags: red-hat-managed=true, api.openshift.com/environment=production, api.openshift.com/id=<cluster_name>, api.openshift.com/legal-entity-id=<legal_entity_id>, api.openshift.com/name=<cluster_name>, api.openshift.com/nodepool-hypershift=<cluster_name>-<machine_pool_name>, api.openshift.com/nodepool-ocm=<machine_pool_name>, red-hat-clustertype=rosa
103+
Taints:
104+
Availability zone: us-east-1a
105+
Subnet: <subnet-id>
106+
Disk Size: 300 GiB
107+
Version: 4.19.10
108+
EC2 Metadata Http Tokens: optional
109+
Autorepair: Yes
110+
Tuning configs:
111+
Kubelet configs:
112+
Additional security group IDs:
113+
Node drain grace period:
114+
Capacity Reservation:
115+
- ID: <capacity-reservation-id>
116+
- Type: OnDemand
117+
Management upgrade:
118+
- Type: Replace
119+
- Max surge: 1
120+
- Max unavailable: 0
121+
Message: Minimum availability requires 1 replicas, current 1 available
122+
----
123+
+
124+
The output should include the Capacity Reservation ID and type.

modules/creating-a-machine-pool-cli.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="creating_machine_pools_cli_{context}"]
7-
= Creating a machine pool using the ROSA CLI
7+
= Creating a machine pool using the {rosa-cli}
88

99
You can create additional machine pools for your {product-title} cluster by using the {rosa-cli-first}.
1010

11+
[NOTE]
12+
====
13+
To add a pre-purchased Capacity Reservation to a machine pool, see link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/cluster_administration/index#creating_machine_pools_cli_rosa-managing-worker-nodes[Creating a machine pool with Capacity Reservations].
14+
====
15+
//Commenting out the not-yet-published link that breaks the build: https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/cluster_administration/index#creating_machine_pools_cli_capres_rosa-managing-worker-nodes Will have to add it here after the new Cap Res module is merged and published.
16+
1117
.Prerequisites
1218

1319
* You installed and configured the latest {rosa-cli} on your workstation.

modules/rosa-create-objects.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,11 @@ $ rosa create machinepool --cluster=<cluster_name> | <cluster_id> --replicas=<nu
853853
|--additional-security-group-ids <sec_group_id>
854854
|The identifier of one or more additional security groups to use along with the default security groups for this machine pool. For more information on additional security groups, see the requirements for _Security groups_ under _Additional resources_.
855855

856+
ifdef::openshift-rosa-hcp[]
857+
|--capacity-reservation-id
858+
|The ID of a pre-purchased AWS Capacity Reservation.
859+
endif::openshift-rosa-hcp[]
860+
856861
a|--cluster <cluster_name>\|<cluster_id>
857862
|Required: The name or ID of the cluster to which the machine pool will be added.
858863

modules/rosa-release-notes-Q4-2025.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* **New version of {product-title} available.** {product-title} version 4.20 is now available for new clusters.
99
1010
ifdef::openshift-rosa-hcp[]
11+
* ** On-Demand Capacity Reservations and Capacity Blocks for ML now supported.** You can now use pre-purchased Capacity Reservations when creating new machine pools on {product-title} clusters. For more information, see link:https://docs.redhat.com/documentation/red_hat_openshift_service_on_aws/4/html-single/cluster_administration/index#rosa-managing-worker-nodes[Managing compute nodes].
12+
1113
* ** ImageDigestMirrorSets (IDMS) now supported.**
1214
{product-title} now supports ImageDigestMirrorSets (IDMS), enabling clusters to redirect image pulls to a private, mirrored registry. This critical enhancement means customers in air-gapped or restricted networks can host their own mirrors for third-party images while satisfying strict security and compliance requirements. For more information, see link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/images/index#images-registry-mirroring_image-configuration-hcp[Image registry mirroring for {product-title}].
1315

rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,37 @@ The majority of changes for compute nodes are configured on machine pools. A mac
1111

1212
You can edit machine pool configuration options such as scaling, adding node labels, and adding taints.
1313

14+
ifdef::openshift-rosa-hcp[]
15+
You can also create new machine pools with Capacity Reservations.
16+
17+
.Overview of AWS Capacity Reservations
18+
19+
If you have reserved compute capacity using link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservation-overview.html[AWS Capacity Reservations] for a specific instance type and Availability Zone (AZ), you can use it for your {product-title} worker nodes. Both On-Demand Capacity Reservations and Capacity Blocks for machine learning (ML) workloads are supported.
20+
21+
Purchase and manage a Capacity Reservation directly with AWS. After reserving the capacity, add a Capacity Reservation ID to a new machine pool when you create it in your {product-title} cluster. You can also use a Capacity Reservation shared with you from another AWS account within your AWS Organization.
22+
23+
Once you configure Capacity Reservations in {product-title}, you can use your AWS account to monitor reserved capacity usage across all workloads in the account.
24+
25+
Using Capacity Reservations on machine pools in {product-title} clusters has the following prerequisites and limitations:
26+
27+
* You have installed the {rosa-cli} version 1.2.57 or above.
28+
* Your {product-title} cluster is version 4.19 or later.
29+
* The cluster already has a machine pool that is not using a Capacity Reservation or taints. The machine pool must have at least 2 worker nodes.
30+
* You have purchased a Capacity Reservation for the instance type required in the AZ of the machine pool that you are creating.
31+
* You can only add a Capacity Reservation ID to a new machine pool.
32+
* You cannot use autoscaling on a machine pool with configured Capacity Reservations.
33+
* You cannot upgrade a machine pool with configured Capacity Reservations.
34+
35+
To create a machine pool with a Capacity Reservation, see xref:../../rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc#creating_machine_pools_cli_capres_rosa-managing-worker-nodes[Creating a machine pool with Capacity Reservations using the {rosa-cli}].
36+
endif::openshift-rosa-hcp[]
37+
1438
include::modules/creating-a-machine-pool.adoc[leveloffset=+1]
1539
include::modules/creating-a-machine-pool-ocm.adoc[leveloffset=+2]
1640
include::modules/creating-a-machine-pool-cli.adoc[leveloffset=+2]
41+
//OSDOCS-14809: Adding a separate module about Capacity Reservations. This might be a temporary solution since this module largely reuses content from modules/creating-a-machine-pool-cli.adoc. We might consider restructuring content from these 2 modules to meet ContentX and DITA migration goals.
42+
ifdef::openshift-rosa-hcp[]
43+
include::modules/creating-a-machine-pool-cli-capres.adoc[leveloffset=+2]
44+
endif::openshift-rosa-hcp[]
1745

1846
// TODO: This additional resource can be added back once all of the files are added to the ROSA HCP distro.
1947
ifndef::openshift-rosa-hcp[]
@@ -30,7 +58,7 @@ include::modules/configuring-machine-pool-disk-volume-cli.adoc[leveloffset=+2]
3058
ifndef::openshift-rosa-hcp[]
3159
[role="_additional-resources"]
3260
.Additional resources
33-
* For a detailed list of the arguments that are available for the `rosa create machinepool` subcommand, see xref:../../cli_reference/rosa_cli/rosa-manage-objects-cli.adoc#rosa-managing-objects-cli[Managing objects with the ROSA CLI].
61+
* For a detailed list of the arguments that are available for the `rosa create machinepool` subcommand, see xref:../../cli_reference/rosa_cli/rosa-manage-objects-cli.adoc#rosa-managing-objects-cli[Managing objects with the {rosa-cli}].
3462
endif::openshift-rosa-hcp[]
3563
3664
include::modules/deleting-machine-pools.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)