1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/learning-getting-started-learning-machine-pool-cli.adoc

72 lines
2.0 KiB
Plaintext
Raw Normal View History

// Module included in the following assemblies:
//
// * rosa_learning/creating_cluster_workshop/learning-getting-started-managing-worker-nodes.adoc
:_mod-docs-content-type: PROCEDURE
[id="learning-getting-started-learning-machine-pool-cli_{context}"]
= Creating a machine pool with the {rosa-cli}
[role="_abstract"]
You can use the {rosa-cli} to create a machine pool.
.Procedure
. Run the following command:
+
[source,terminal]
----
$ rosa create machinepool --cluster=<cluster-name> --name=<machinepool-name> --replicas=<number-nodes>
----
+
*For example*:
+
[source,terminal]
----
$ rosa create machinepool --cluster=my-rosa-cluster --name=new-mp
--replicas=2
----
+
*Example output*:
+
[source,terminal]
----
I: Machine pool 'new-mp' created successfully on cluster 'my-rosa-cluster'
I: To view all machine pools, run 'rosa list machinepools -c my-rosa-cluster'
----
. *Optional:* Add node labels or taints to specific nodes in a new machine pool by running the following command:
+
[source,terminal]
----
$ rosa create machinepool --cluster=<cluster-name> --name=<machinepool-name> --replicas=<number-nodes> --labels=`<key=pair>`
----
+
*For example*:
+
[source,terminal]
----
$ rosa create machinepool --cluster=my-rosa-cluster --name=db-nodes-mp --replicas=2 --labels='app=db','tier=backend'
----
+
*Example output*:
+
[source,terminal]
----
I: Machine pool 'db-nodes-mp' created successfully on cluster 'my-rosa-cluster'
----
+
This creates an additional 2 nodes that can be managed as a unit and also assigns them the labels shown.
. Run the following command to confirm machine pool creation and the assigned labels:
+
[source,terminal]
----
$ rosa list machinepools --cluster=<cluster-name>
----
+
*Example output*:
+
[source,terminal]
----
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONE SUBNET DISK SIZE VERSION AUTOREPAIR
workers Yes 2/2-4 m5.xlarge us-east-1f subnet-<subnet_id> 300 GiB 4.14.36 Yes
----