Can we add taints to the default machinepool in ROSA ?
Environment
- Red Hat OpenShift Service on AWS
- 4.x
- rosa cli
- 1.2.26
Issue
- You want to add taints to worker nodes provisioned by the default machinepool in ROSA.
Resolution
- You can add the taints to the default machinepool when met the following prerequisites. Refer Adding taints to a machine pool using Openshift Cluster Manager for more details.
- At least one machine pool able to run OCP workload is required except the default machinepool.
- The pool should not have taints.
- Minimum replica count should be '2' in Single AZ.
- Minimum replica count should be '3' in Multi AZ.
- Here is a sample in Single AZ cluster of ROSA.
$ rosa version
1.2.26
I: Your ROSA CLI is up to date.
#1. "worker" is the default machinepool ID name.
$ rosa list machinepool --cluster=rosa-test
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SUBNETS SPOT INSTANCES DISK SIZE
worker No 2 m5.xlarge ap-northeast-1a No default
#2. When adding a taint to the default machinepool as follows, it's failed with informational error messages.
$ rosa edit machinepool --cluster=rosa-test worker --taints=key1=value1:NoSchedule
E: Failed to update machine pool 'worker' on cluster 'rosa-test': Machine pool 'worker' for cluster 'xxxxx' can't be updated with provided params.
At least one machine pool able to run OCP workload is required. Pool should not have taints and minimum replica count should be '2'
#3. Added a "additional" machinepool for meeting the prerequisites to edit taint in the default machinepool as follows.
$ rosa create machinepool --cluster=rosa-test --name=additional --replicas=2 --instance-type=m5.xlarge
I: Fetching instance types
I: Machine pool 'additional' created successfully on cluster 'rosa-test'
I: To view all machine pools, run 'rosa list machinepools -c rosa-test'
$ rosa list machinepool --cluster=rosa-test
ID AUTOSCALING REPLICAS INSTANCE TYPE LABELS TAINTS AVAILABILITY ZONES SUBNETS SPOT INSTANCES DISK SIZE
additional No 2 m5.xlarge ap-northeast-1a No default
worker No 2 m5.xlarge ap-northeast-1a No default
#4. Try to add a taint to the default machinepool as follows, this time the operation was successful.
$ rosa edit machinepool --cluster=rosa-test worker --taints=key1=value1:NoSchedule
I: Updated machine pool 'worker' on cluster 'rosa-test'
#5. Check the taint status in the worker nodes managed by the default machinepool as follows. You can see the taint configuration was added.
$ oc describe node ip-10-0-xx-xx.ap-northeast-1.compute.internal | grep Taints:
Taints: key1=value1:NoSchedule
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments