Skip to content

Commit cf2a0d6

Browse files
authored
Merge pull request #43045 from pneedle-rh/osdocs-3284-adding-create-machine-pool-content
OSDOCS-3284 - Adding OSD and ROSA sections on creating machine pools
2 parents 8ccf851 + abd74e5 commit cf2a0d6

11 files changed

+541
-131
lines changed

_topic_maps/_topic_map_osd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Distros: openshift-dedicated
150150
Topics:
151151
- Name: About machine pools
152152
File: nodes-machinepools-about
153-
- Name: Managing worker nodes
153+
- Name: Managing compute nodes
154154
File: rosa-managing-worker-nodes
155155
- Name: About autoscaling nodes on a cluster
156156
File: nodes-about-autoscaling-nodes

_topic_maps/_topic_map_rosa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Topics:
206206
Topics:
207207
- Name: About machine pools
208208
File: rosa-nodes-machinepools-about
209-
- Name: Managing worker nodes
209+
- Name: Managing compute nodes
210210
File: rosa-managing-worker-nodes
211211
Distros: openshift-rosa
212212
- Name: About autoscaling nodes on a cluster
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes/rosa-managing-worker-nodes.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="creating_machine_pools_cli_{context}"]
7+
= Creating a machine pool using the ROSA CLI
8+
9+
You can create additional machine pools for your {product-title} (ROSA) cluster by using the ROSA CLI (`rosa`).
10+
11+
.Prerequisites
12+
13+
* You installed and configured the latest AWS (`aws`), ROSA (`rosa`), and OpenShift (`oc`) CLIs on your workstation.
14+
* You logged in to your Red Hat account by using the `rosa` CLI.
15+
* You created a ROSA cluster.
16+
17+
.Procedure
18+
19+
* To add a machine pool that does not use autoscaling, create the machine pool and define the instance type, compute (also known as worker) node count, and node labels:
20+
+
21+
[source,terminal]
22+
----
23+
$ rosa create machinepool --cluster=<cluster-name> \
24+
--name=<machine_pool_id> \ <1>
25+
--replicas=<replica_count> \ <2>
26+
--instance-type=<instance_type> \ <3>
27+
--labels=<key>=<value>,<key>=<value> \ <4>
28+
--taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <5>
29+
--use-spot-instances \ <6>
30+
--spot-max-price=0.5 <7>
31+
----
32+
<1> Specifies the name of the machine pool. Replace `<machine_pool_id>` with the name of your machine pool.
33+
<2> Specifies the number of compute nodes to provision. If you deployed ROSA using a single availability zone, this defines the number of compute nodes to provision to the machine pool for the zone. If you deployed your cluster using multiple availability zones, this defines the number of compute nodes to provision in total across all zones and the count must be a multiple of 3. The `--replicas` argument is required when autoscaling is not configured.
34+
<3> Optional: Sets 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.
35+
<4> Optional: Defines the labels for the machine pool. Replace `<key>=<value>,<key>=<value>` with a comma-delimited list of key-value pairs, for example `--labels=key1=value1,key2=value2`.
36+
<5> Optional: Defines the taints for the machine pool. Replace `<key>=<value>:<effect>,<key>=<value>:<effect>` with a key, value, and effect for each taint, for example `--taints=key1=value1:NoSchedule,key2=value2:NoExecute`. Available effects include `NoSchedule`, `PreferNoSchedule`, and `NoExecute`.
37+
<6> Optional: Configures your machine pool to deploy machines as non-guaranteed AWS Spot Instances. For information, see link:https://aws.amazon.com/ec2/spot/[Amazon EC2 Spot Instances] in the AWS documentation. If you select *Use Amazon EC2 Spot Instances* for a machine pool, you cannot disable the option after the machine pool is created.
38+
<7> Optional: If you have opted to use Spot Instances, you can specify this argument to define a maximum hourly price for a Spot Instance. If this argument is not specified, the on-demand price is used.
39+
+
40+
[IMPORTANT]
41+
====
42+
Your Amazon EC2 Spot Instances might be interrupted at any time. Use Amazon EC2 Spot Instances only for workloads that can tolerate interruptions.
43+
====
44+
+
45+
The following example creates a machine pool called `mymachinepool` that uses the `m5.xlarge` instance type and has 2 compute node replicas. The example also adds 2 workload-specific labels:
46+
+
47+
[source,terminal]
48+
----
49+
$ rosa create machinepool --cluster=mycluster --name=mymachinepool --replicas=2 --instance-type=m5.xlarge --labels=app=db,tier=backend
50+
----
51+
+
52+
.Example output
53+
[source,terminal]
54+
----
55+
I: Machine pool 'mymachinepool' created successfully on cluster 'mycluster'
56+
I: To view all machine pools, run 'rosa list machinepools -c mycluster'
57+
----
58+
59+
* To add a machine pool that uses autoscaling, create the machine pool and define the autoscaling configuration, instance type and node labels:
60+
+
61+
[source,terminal]
62+
----
63+
$ rosa create machinepool --cluster=<cluster-name> \
64+
--name=<machine_pool_id> \ <1>
65+
--enable-autoscaling \ <2>
66+
--min-replicas=<minimum_replica_count> \ <3>
67+
--max-replicas=<maximum_replica_count> \ <3>
68+
--instance-type=<instance_type> \ <4>
69+
--labels=<key>=<value>,<key>=<value> \ <5>
70+
--taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <6>
71+
--use-spot-instances \ <7>
72+
--spot-max-price=0.5 <8>
73+
----
74+
<1> Specifies the name of the machine pool. Replace `<machine_pool_id>` with the name of your machine pool.
75+
<2> Enables autoscaling in the machine pool to meet the deployment needs.
76+
<3> Defines the minimum and maximum compute node limits. The cluster autoscaler does not reduce or increase the machine pool node count beyond the limits that you specify. If you deployed ROSA using a single availability zone, the `--min-replicas` and `--max-replicas` arguments define the autoscaling limits in the machine pool for the zone. If you deployed your cluster using multiple availability zones, the arguments define the autoscaling limits in total across all zones and the counts must be multiples of 3.
77+
<4> Optional: Sets 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.
78+
<5> Optional: Defines the labels for the machine pool. Replace `<key>=<value>,<key>=<value>` with a comma-delimited list of key-value pairs, for example `--labels=key1=value1,key2=value2`.
79+
<6> Optional: Defines the taints for the machine pool. Replace `<key>=<value>:<effect>,<key>=<value>:<effect>` with a key, value, and effect for each taint, for example `--taints=key1=value1:NoSchedule,key2=value2:NoExecute`. Available effects include `NoSchedule`, `PreferNoSchedule`, and `NoExecute`.
80+
<7> Optional: Configures your machine pool to deploy machines as non-guaranteed AWS Spot Instances. For information, see link:https://aws.amazon.com/ec2/spot/[Amazon EC2 Spot Instances] in the AWS documentation. If you select *Use Amazon EC2 Spot Instances* for a machine pool, you cannot disable the option after the machine pool is created.
81+
<8> Optional: If you have opted to use Spot Instances, you can specify this argument to define a maximum hourly price for a Spot Instance. If this argument is not specified, the on-demand price is used.
82+
+
83+
[IMPORTANT]
84+
====
85+
Your Amazon EC2 Spot Instances might be interrupted at any time. Use Amazon EC2 Spot Instances only for workloads that can tolerate interruptions.
86+
====
87+
+
88+
The following example creates a machine pool called `mymachinepool` that uses the `m5.xlarge` instance type and has autoscaling enabled. The minimum compute node limit is 3 and the maximum is 6 overall. The example also adds 2 workload-specific labels:
89+
+
90+
[source,terminal]
91+
----
92+
$ rosa create machinepool --cluster=mycluster --name=mymachinepool --enable-autoscaling --min-replicas=3 --max-replicas=6 --instance-type=m5.xlarge --labels=app=db,tier=backend
93+
----
94+
+
95+
.Example output
96+
[source,terminal]
97+
----
98+
I: Machine pool 'mymachinepool' created successfully on cluster 'mycluster'
99+
I: To view all machine pools, run 'rosa list machinepools -c mycluster'
100+
----
101+
102+
.Verification
103+
104+
. List the available machine pools in your cluster:
105+
+
106+
[source,terminal]
107+
----
108+
$ rosa list machinepools --cluster=<cluster_name>
109+
----
110+
+
111+
.Example output
112+
[source,terminal]
113+
----
114+
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES
115+
Default No 3 m5.xlarge us-east-1a, us-east-1b, us-east-1c N/A
116+
mymachinepool Yes 3-6 m5.xlarge app=db, tier=backend us-east-1a, us-east-1b, us-east-1c No
117+
----
118+
119+
. Verify that the machine pool is included in the output and the configuration is as expected.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes/rosa-managing-worker-nodes.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="creating_machine_pools_ocm_{context}"]
7+
ifndef::openshift-rosa[]
8+
= Creating a machine pool
9+
endif::openshift-rosa[]
10+
ifdef::openshift-rosa[]
11+
= Creating a machine pool using OpenShift Cluster Manager
12+
endif::openshift-rosa[]
13+
14+
ifndef::openshift-rosa[]
15+
A default machine pool is created when you install an {product-title} cluster. After installation, you can create additional machine pools for your cluster by using {cluster-manager}.
16+
endif::openshift-rosa[]
17+
ifdef::openshift-rosa[]
18+
You can create additional machine pools for your {product-title} (ROSA) cluster by using {cluster-manager}.
19+
endif::openshift-rosa[]
20+
21+
ifndef::openshift-rosa[]
22+
[IMPORTANT]
23+
====
24+
The compute (also known as worker) node instance types, autoscaling options, and node counts that are available to you depend on your
25+
ifdef::openshift-rosa[]
26+
ROSA
27+
endif::openshift-rosa[]
28+
ifndef::openshift-rosa[]
29+
{product-title}
30+
endif::[]
31+
subscriptions, resource quotas and deployment scenario. For more information, contact your sales representative or Red Hat support.
32+
====
33+
endif::openshift-rosa[]
34+
35+
.Prerequisites
36+
37+
ifdef::openshift-rosa[]
38+
* You created a ROSA cluster.
39+
endif::openshift-rosa[]
40+
ifndef::openshift-rosa[]
41+
* You created an {product-title} cluster.
42+
endif::[]
43+
44+
.Procedure
45+
46+
. Navigate to {cluster-manager-url} and select your cluster.
47+
48+
. Under the *Machine pools* tab, click *Add machine pool*.
49+
50+
. Add a *Machine pool name*.
51+
52+
. Select a *Worker node instance type* from the drop-down menu. The instance type defines the vCPU and memory allocation for each compute node in the machine pool.
53+
+
54+
[NOTE]
55+
====
56+
You cannot change the instance type for a machine pool after the pool is created.
57+
====
58+
59+
. Optional: Configure autoscaling for the machine pool:
60+
.. Select *Enable autoscaling* to automatically scale the number of machines in your machine pool to meet the deployment needs.
61+
ifdef::openshift-dedicated[]
62+
+
63+
[NOTE]
64+
====
65+
The *Enable autoscaling* option is only available for {product-title} if you have the `capability.cluster.autoscale_clusters` subscription. For more information, contact your sales representative or Red Hat support.
66+
====
67+
endif::openshift-dedicated[]
68+
.. Set the minimum and maximum node count limits for autoscaling. The cluster autoscaler does not reduce or increase the machine pool node count beyond the limits that you specify.
69+
** If you deployed your cluster using a single availability zone, set the *Minimum and maximum node count*. This defines the minimum and maximum compute node limits in the availability zone.
70+
** If you deployed your cluster using multiple availability zones, set the *Minimum nodes per zone* and *Maximum nodes per zone*. This defines the minimum and maximum compute node limits per zone.
71+
+
72+
[NOTE]
73+
====
74+
Alternatively, you can set your autoscaling preferences for the machine pool after the machine pool is created.
75+
====
76+
77+
. If you did not enable autoscaling, select a compute node count:
78+
* If you deployed your cluster using a single availability zone, select a *Worker node count* from the drop-down menu. This defines the number of compute nodes to provision to the machine pool for the zone.
79+
* If you deployed your cluster using multiple availability zones, select a *Worker node count (per zone)* from the drop-down menu. This defines the number of compute nodes to provision to the machine pool per zone.
80+
81+
. Optional: Add node labels and taints for your machine pool:
82+
.. Expand the *Edit node labels and taints* menu.
83+
.. Under *Node labels*, add *Key* and *Value* entries for your node labels.
84+
.. Under *Taints*, add *Key* and *Value* entries for your taints.
85+
.. For each taint, select an *Effect* from the drop-down menu. Available options include `NoSchedule`, `PreferNoSchedule`, and `NoExecute`.
86+
+
87+
[NOTE]
88+
====
89+
Alternatively, you can add the node labels and taints after you create the machine pool.
90+
====
91+
92+
ifdef::openshift-dedicated[]
93+
. Optional: If you deployed {product-title} on AWS using the Customer Cloud Subscription (CCS) model, use Amazon EC2 Spot Instances if you want to configure your machine pool to deploy machines as non-guaranteed AWS Spot Instances:
94+
.. Select *Use Amazon EC2 Spot Instances*.
95+
.. Leave *Use On-Demand instance price* selected to use the on-demand instance price. Alternatively, select *Set maximum price* to define a maximum hourly price for a Spot Instance.
96+
+
97+
For more information about Amazon EC2 Spot Instances, see the link:https://aws.amazon.com/ec2/spot/[AWS documentation].
98+
endif::openshift-dedicated[]
99+
ifdef::openshift-rosa[]
100+
. Optional: Use Amazon EC2 Spot Instances if you want to configure your machine pool to deploy machines as non-guaranteed AWS Spot Instances:
101+
.. Select *Use Amazon EC2 Spot Instances*.
102+
.. Leave *Use On-Demand instance price* selected to use the on-demand instance price. Alternatively, select *Set maximum price* to define a maximum hourly price for a Spot Instance.
103+
+
104+
For more information about Amazon EC2 Spot Instances, see the link:https://aws.amazon.com/ec2/spot/[AWS documentation].
105+
endif::openshift-rosa[]
106+
+
107+
[IMPORTANT]
108+
====
109+
Your Amazon EC2 Spot Instances might be interrupted at any time. Use Amazon EC2 Spot Instances only for workloads that can tolerate interruptions.
110+
====
111+
+
112+
[NOTE]
113+
====
114+
If you select *Use Amazon EC2 Spot Instances* for a machine pool, you cannot disable the option after the machine pool is created.
115+
====
116+
117+
. Click *Add machine pool* to create the machine pool.
118+
119+
.Verification
120+
121+
* Verify that the machine pool is visible on the *Machine pools* page and the configuration is as expected.

modules/creating-a-machine-pool.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes/rosa-managing-worker-nodes.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="creating_a_machine_pool_{context}"]
7+
= Creating a machine pool
8+
9+
A default machine pool is created when you install a {product-title} (ROSA) cluster. After installation, you can create additional machine pools for your cluster by using {cluster-manager} or the ROSA CLI (`rosa`).

modules/rosa-adding-instance-types.adoc

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)