|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc |
| 4 | +// * nodes/rosa-managing-worker-nodes.adoc |
| 5 | +// * osd_cluster_admin/osd_nodes/osd-managing-worker-nodes.adoc |
| 6 | + |
| 7 | +:_content-type: PROCEDURE |
| 8 | +[id="rosa-adding-taints-cli{context}"] |
| 9 | += Adding taints to a machine pool using the ROSA CLI |
| 10 | + |
| 11 | +You can add taints to a machine pool for your Red Hat OpenShift Service on AWS (ROSA) cluster by using the ROSA CLI. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +ifdef::openshift-rosa[] |
| 16 | +* You installed and configured the latest AWS (`aws`), ROSA (`rosa`), and OpenShift (`oc`) CLIs on your workstation. |
| 17 | +* You logged in to your Red Hat account by using the `rosa` CLI. |
| 18 | +* You created a {product-title} (ROSA) cluster. |
| 19 | +endif::openshift-rosa[] |
| 20 | +ifndef::openshift-rosa[] |
| 21 | +* You created an {product-title} cluster. |
| 22 | +endif::[] |
| 23 | +* You have an existing machine pool that does not contain any taints and contains at least two instances. |
| 24 | + |
| 25 | +.Procedure |
| 26 | + |
| 27 | +ifdef::openshift-rosa[] |
| 28 | +. List the machine pools in the cluster by running the following command: |
| 29 | ++ |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +$ rosa list machinepools --cluster=<cluster_name> |
| 33 | +---- |
| 34 | ++ |
| 35 | +.Example output |
| 36 | ++ |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES |
| 40 | +Default No 2 m5.xlarge us-east-1a N/A |
| 41 | +db-nodes-mp No 2 m5.xlarge us-east-1a No |
| 42 | +---- |
| 43 | + |
| 44 | +. Add or update the taints for a machine pool: |
| 45 | + |
| 46 | +* To add or update taints for a machine pool that does not use autoscaling, run the following command: |
| 47 | ++ |
| 48 | +[source,terminal] |
| 49 | +---- |
| 50 | +$ rosa edit machinepool --cluster=<cluster_name> \ |
| 51 | + --replicas=<replica_count> \ <1> |
| 52 | + --taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <2> |
| 53 | + <machine_pool_id> |
| 54 | +---- |
| 55 | +<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. |
| 56 | +<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. |
| 57 | ++ |
| 58 | +The following example adds taints to the `db-nodes-mp` machine pool: |
| 59 | ++ |
| 60 | +[source,terminal] |
| 61 | +---- |
| 62 | +$ rosa edit machinepool --cluster=mycluster --replicas 2 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp |
| 63 | +---- |
| 64 | ++ |
| 65 | +.Example output |
| 66 | +[source,terminal] |
| 67 | +---- |
| 68 | +I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster' |
| 69 | +---- |
| 70 | +
|
| 71 | +* To add or update taints for a machine pool that uses autoscaling, run the following command: |
| 72 | ++ |
| 73 | +[source,terminal] |
| 74 | +---- |
| 75 | +$ rosa edit machinepool --cluster=<cluster_name> \ |
| 76 | + --min-replicas=<minimum_replica_count> \ <1> |
| 77 | + --max-replicas=<maximum_replica_count> \ <1> |
| 78 | + --taints=<key>=<value>:<effect>,<key>=<value>:<effect> \ <2> |
| 79 | + <machine_pool_id> |
| 80 | +---- |
| 81 | +<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. |
| 82 | +<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. |
| 83 | ++ |
| 84 | +The following example adds taints to the `db-nodes-mp` machine pool: |
| 85 | ++ |
| 86 | +[source,terminal] |
| 87 | +---- |
| 88 | +$ rosa edit machinepool --cluster=mycluster --min-replicas=2 --max-replicas=3 --taints=key1=value1:NoSchedule,key2=value2:NoExecute db-nodes-mp |
| 89 | +---- |
| 90 | ++ |
| 91 | +.Example output |
| 92 | +[source,terminal] |
| 93 | +---- |
| 94 | +I: Updated machine pool 'db-nodes-mp' on cluster 'mycluster' |
| 95 | +---- |
| 96 | +
|
| 97 | +.Verification |
| 98 | + |
| 99 | +. List the available machine pools in your cluster by running the following command: |
| 100 | ++ |
| 101 | +[source,terminal] |
| 102 | +---- |
| 103 | +$ rosa list machinepools --cluster=<cluster_name> |
| 104 | +---- |
| 105 | ++ |
| 106 | +.Example output |
| 107 | +[source,terminal] |
| 108 | +---- |
| 109 | +ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SPOT INSTANCES |
| 110 | +Default No 2 m5.xlarge us-east-1a N/A |
| 111 | +db-nodes-mp No 2 m5.xlarge key1=value1:NoSchedule, key2=value2:NoExecute us-east-1a No |
| 112 | +---- |
| 113 | + |
| 114 | +. Verify that the taints are included for your machine pool in the output. |
| 115 | +endif::[] |
0 commit comments