Disable a machine autoscaler
To disable a machine autoscaler, you delete the corresponding MachineAutoscaler custom resource (CR).
|
|
Disabling a machine autoscaler does not disable the cluster autoscaler. To disable the cluster autoscaler, follow the instructions in "Disabling the cluster autoscaler". |
-
List the
MachineAutoscalerCRs for the cluster by running the following command:$ oc get MachineAutoscaler -n openshift-machine-apiExample outputNAME REF KIND REF NAME MIN MAX AGE compute-us-east-1a MachineSet compute-us-east-1a 1 12 39m compute-us-west-1a MachineSet compute-us-west-1a 2 4 37m -
Optional: Create a YAML file backup of the
MachineAutoscalerCR by running the following command:$ oc get MachineAutoscaler/<machine_autoscaler_name> \ -n openshift-machine-api \ -o yaml> <machine_autoscaler_name_backup>.yamlwhere:
- <machine_autoscaler_name_backup>
-
Specifies the file name in which to store the backup.
-
Delete the
MachineAutoscalerCR by running the following command:$ oc delete MachineAutoscaler/<machine_autoscaler_name> -n openshift-machine-apiExample outputmachineautoscaler.autoscaling.openshift.io "compute-us-east-1a" deleted
-
To verify that the machine autoscaler is disabled, run the following command:
$ oc get MachineAutoscaler -n openshift-machine-apiThe disabled machine autoscaler does not appear in the list of machine autoscalers.
-
If you need to re-enable the machine autoscaler, use the
<machine_autoscaler_name_backup>.yamlbackup file and follow the instructions in "Deploying a machine autoscaler".