1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/rosa-adding-taints-cli.adoc
Laura Bailey abe17f69af [200~OSDOCS-8034 support for additional cluster security groups at cluster and machine pool creation
- added reqs and limits for additional custom security groups to environment preparation and to cloud expert brief prerequisite list
- updated required aws service quotas section with clearer examples and new security group quota requirement
- added security group selection to the interactive cluster creation process for ROSA Classic clusters
- added security group selection to interactive cluster reference table
- updated command usage examples to include new command and output where relevant
- rebased to incorporate changes from tag related updates
- applied SME and QE review feedback to additional security groups content
- applied peer review feedback for style and link conventions
- rebased to incorporate changes from _mod-docs-content-type metadata tag change
- correcting cross references
2023-11-06 15:18:50 +00:00

119 lines
6.3 KiB
Plaintext

// Module included in the following assemblies:
//
// * rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc
// * nodes/rosa-managing-worker-nodes.adoc
// * osd_cluster_admin/osd_nodes/osd-managing-worker-nodes.adoc
:_mod-docs-content-type: PROCEDURE
[id="rosa-adding-taints-cli{context}"]
= Adding taints to a machine pool using the ROSA CLI
You can add taints to a machine pool for your Red Hat OpenShift Service on AWS (ROSA) cluster by using the ROSA CLI.
[NOTE]
====
For users of ROSA CLI `rosa` version 1.2.25 and prior versions, the number of taints cannot be changed within the machine pool (ID=`Default`) created along with the cluster. For users of ROSA CLI `rosa` version 1.2.26 and beyond, the number of taints can be changed within the machine pool (ID=`worker`) created along with the cluster. There must be at least one machine pool without any taints and with at least two replicas for a Single-AZ cluster or three replicas for a Multi-AZ cluster.
====
.Prerequisites
ifdef::openshift-rosa[]
* You installed and configured the latest AWS (`aws`), ROSA (`rosa`), and OpenShift (`oc`) CLIs on your workstation.
* You logged in to your Red Hat account by using the `rosa` CLI.
* You created a {product-title} (ROSA) cluster.
endif::openshift-rosa[]
ifndef::openshift-rosa[]
* You created an {product-title} cluster.
endif::[]
* You have an existing machine pool that does not contain any taints and contains at least two instances.
.Procedure
ifdef::openshift-rosa[]
. List the machine pools in the cluster by running the following command:
+
[source,terminal]
----
$ rosa list machinepools --cluster=<cluster_name>
----
+
.Example output
+
[source,terminal]
----
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES DISK SIZE SG IDs
Default No 2 m5.xlarge us-east-1a N/A 300 GiB sg-0e375ff0ec4a6cfa2
db-nodes-mp No 2 m5.xlarge us-east-1a No 300 GiB sg-0e375ff0ec4a6cfa2
----
. Add or update the taints for a machine pool:
* To add or update taints for a machine pool that does not use autoscaling, run the following command:
+
[source,terminal]
----
$ rosa edit machinepool --cluster=<cluster_name> \
--replicas=<replica_count> \ <1>
--taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <2>
<machine_pool_id>
----
<1> For machine pools that do not use autoscaling, you must provide a replica count when adding taints. If you do not specify the `--replicas` argument, you are prompted for a replica count before the command completes. If you deployed {product-title} (ROSA) using a single availability zone, the replica count defines the number of compute nodes to provision to the machine pool for the zone. If you deployed your cluster using multiple availability zones, the count defines the total number of compute nodes in the machine pool across all zones and must be a multiple of 3.
<2> 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`.This list overwrites any modifications made to node taints on an ongoing basis.
+
The following example adds taints to the `db-nodes-mp` machine pool:
+
[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster --replicas 2 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp
----
+
.Example output
[source,terminal]
----
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
----
* To add or update taints for a machine pool that uses autoscaling, run the following command:
+
[source,terminal]
----
$ rosa edit machinepool --cluster=<cluster_name> \
--min-replicas=<minimum_replica_count> \ <1>
--max-replicas=<maximum_replica_count> \ <1>
--taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <2>
<machine_pool_id>
----
<1> For machine pools that use autoscaling, you must provide minimum and maximum compute node replica limits. If you do not specify the arguments, you are prompted for the values before the command completes. 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.
<2> 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`. This list overwrites any modifications made to node taints on an ongoing basis.
+
The following example adds taints to the `db-nodes-mp` machine pool:
+
[source,terminal]
----
$ rosa edit machinepool --cluster=mycluster --min-replicas=2 --max-replicas=3 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp
----
+
.Example output
[source,terminal]
----
I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster'
----
.Verification
. List the available machine pools in your cluster by running the following command:
+
[source,terminal]
----
$ rosa list machinepools --cluster=<cluster_name>
----
+
.Example output
[source,terminal]
----
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES DISK SIZE SG IDs
Default No 2 m5.xlarge us-east-1a N/A 300GiB sg-0e375ff0ec4a6cfa2
db-nodes-mp No 2 m5.xlarge key1=value1:NoSchedule, key2=value2:NoExecute us-east-1a No 300GiB sg-0e375ff0ec4a6cfa2
----
. Verify that the taints are included for your machine pool in the output.
endif::[]