Skip to content

Commit 4a27b7f

Browse files
authored
Merge pull request #61853 from jeana-redhat/OCPBUGS-15211-deleting-autoscaler-resources
[OCPBUGS-15211]: Steps to disable autoscalers
2 parents e09db46 + f4b7418 commit 4a27b7f

File tree

6 files changed

+175
-16
lines changed

6 files changed

+175
-16
lines changed

machine_management/applying-autoscaling.adoc

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Applying autoscaling to an {product-title} cluster involves deploying a cluster
1010

1111
[IMPORTANT]
1212
====
13-
You can configure the cluster autoscaler only in clusters where the machine API is operational.
13+
You can configure the cluster autoscaler only in clusters where the Machine API Operator is operational.
1414
====
1515

1616
include::modules/cluster-autoscaler-about.adoc[leveloffset=+1]
1717

18-
[id="configuring-clusterautoscaler"]
18+
[id="configuring-clusterautoscaler_{context}"]
1919
== Configuring the cluster autoscaler
2020

2121
First, deploy the cluster autoscaler to manage automatic resource scaling in your {product-title} cluster.
@@ -30,15 +30,13 @@ include::modules/cluster-autoscaler-cr.adoc[leveloffset=+2]
3030
:FeatureName: cluster autoscaler
3131
:FeatureResourceName: ClusterAutoscaler
3232
include::modules/deploying-resource.adoc[leveloffset=+2]
33-
34-
== Next steps
35-
36-
* After you configure the cluster autoscaler, you must configure at least one machine autoscaler.
33+
.Next steps
34+
* After you configure the cluster autoscaler, you must xref:../machine_management/applying-autoscaling.adoc#configuring-machineautoscaler_applying-autoscaling[configure at least one machine autoscaler].
3735

3836
include::modules/machine-autoscaler-about.adoc[leveloffset=+1]
3937

40-
[id="configuring-machineautoscaler"]
41-
== Configuring the machine autoscalers
38+
[id="configuring-machineautoscaler_{context}"]
39+
== Configuring machine autoscalers
4240

4341
After you deploy the cluster autoscaler, deploy `MachineAutoscaler` resources that reference the compute machine sets that are used to scale the cluster.
4442

@@ -58,7 +56,24 @@ include::modules/machine-autoscaler-cr.adoc[leveloffset=+2]
5856
:FeatureResourceName: MachineAutoscaler
5957
include::modules/deploying-resource.adoc[leveloffset=+2]
6058

59+
[id="disabling-autoscaling_{context}"]
60+
== Disabling autoscaling
61+
62+
You can disable an individual machine autoscaler in your cluster or disable autoscaling on the cluster entirely.
63+
64+
include::modules/deleting-machine-autoscaler.adoc[leveloffset=+2]
65+
[role="_additional-resources"]
66+
.Additional resources
67+
* xref:../machine_management/applying-autoscaling.adoc#deleting-cluster-autoscaler_applying-autoscaling[Disabling the cluster autoscaler]
68+
* xref:../machine_management/applying-autoscaling.adoc#MachineAutoscaler-deploying_applying-autoscaling[Deploying a machine autoscaler]
69+
70+
include::modules/deleting-cluster-autoscaler.adoc[leveloffset=+2]
71+
[role="_additional-resources"]
72+
.Additional resources
73+
* xref:../machine_management/applying-autoscaling.adoc#deleting-machine-autoscaler_applying-autoscaling[Disabling the machine autoscaler]
74+
* xref:../machine_management/applying-autoscaling.adoc#ClusterAutoscaler-deploying_applying-autoscaling[Deploying a cluster autoscaler]
75+
6176
[role="_additional-resources"]
6277
== Additional resources
6378

64-
* For more information about pod priority, see xref:../nodes/pods/nodes-pods-priority.adoc#nodes-pods-priority[Including pod priority in pod scheduling decisions in {product-title}].
79+
* xref:../nodes/pods/nodes-pods-priority.adoc#nodes-pods-priority[Including pod priority in pod scheduling decisions in {product-title}]

modules/cluster-autoscaler-cr.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
:_content-type: REFERENCE
77
[id="cluster-autoscaler-cr_{context}"]
8-
= ClusterAutoscaler resource definition
8+
= Cluster autoscaler resource definition
99

1010
This `ClusterAutoscaler` resource definition shows the parameters and sample values for the cluster autoscaler.
1111

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/applying-autoscaling.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="deleting-cluster-autoscaler_{context}"]
7+
= Disabling the cluster autoscaler
8+
9+
To disable the cluster autoscaler, you delete the corresponding `ClusterAutoscaler` resource.
10+
11+
[NOTE]
12+
====
13+
Disabling the cluster autoscaler disables autoscaling on the cluster, even if the cluster has existing machine autoscalers.
14+
====
15+
16+
.Procedure
17+
18+
. List the `ClusterAutoscaler` resource for the cluster by running the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc get ClusterAutoscaler
23+
----
24+
+
25+
.Example output
26+
[source,terminal]
27+
----
28+
NAME AGE
29+
default 42m
30+
----
31+
32+
. Optional: Create a YAML file backup of the `ClusterAutoscaler` CR by running the following command:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc get ClusterAutoscaler/default \//<1>
37+
-o yaml> <cluster_autoscaler_backup_name>.yaml //<2>
38+
----
39+
<1> `default` is the name of the `ClusterAutoscaler` CR.
40+
<2> `<cluster_autoscaler_backup_name>` is the name for the backup of the CR.
41+
42+
. Delete the `ClusterAutoscaler` CR by running the following command:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc delete ClusterAutoscaler/default
47+
----
48+
+
49+
.Example output
50+
[source,terminal]
51+
----
52+
clusterautoscaler.autoscaling.openshift.io "default" deleted
53+
----
54+
55+
.Verification
56+
57+
* To verify that the cluster autoscaler is disabled, run the following command:
58+
+
59+
[source,terminal]
60+
----
61+
$ oc get ClusterAutoscaler
62+
----
63+
+
64+
.Expected output
65+
[source,terminal]
66+
----
67+
No resources found
68+
----
69+
70+
.Next steps
71+
72+
* Disabling the cluster autoscaler by deleting the `ClusterAutoscaler` CR prevents the cluster from autoscaling but does not delete any existing machine autoscalers on the cluster. To clean up unneeded machine autoscalers, see "Disabling a machine autoscaler".
73+
74+
* If you need to re-enable the cluster autoscaler, use the `<cluster_autoscaler_name_backup>.yaml` backup file and follow the instructions in "Deploying a cluster autoscaler".
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/applying-autoscaling.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="deleting-machine-autoscaler_{context}"]
7+
= Disabling a machine autoscaler
8+
9+
To disable a machine autoscaler, you delete the corresponding `MachineAutoscaler` custom resource (CR).
10+
11+
[NOTE]
12+
====
13+
Disabling a machine autoscaler does not disable the cluster autoscaler. To disable the cluster autoscaler, follow the instructions in "Disabling the cluster autoscaler".
14+
====
15+
16+
.Procedure
17+
18+
. List the `MachineAutoscaler` CRs for the cluster by running the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc get MachineAutoscaler -n openshift-machine-api
23+
----
24+
+
25+
.Example output
26+
[source,terminal]
27+
----
28+
NAME REF KIND REF NAME MIN MAX AGE
29+
compute-us-east-1a MachineSet compute-us-east-1a 1 12 39m
30+
compute-us-west-1a MachineSet compute-us-west-1a 2 4 37m
31+
----
32+
33+
. Optional: Create a YAML file backup of the `MachineAutoscaler` CR by running the following command:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc get MachineAutoscaler/<machine_autoscaler_name> \//<1>
38+
-n openshift-machine-api \
39+
-o yaml> <machine_autoscaler_name_backup>.yaml //<2>
40+
----
41+
<1> `<machine_autoscaler_name>` is the name of the CR that you want to delete.
42+
<2> `<machine_autoscaler_name_backup>` is the name for the backup of the CR.
43+
44+
. Delete the `MachineAutoscaler` CR by running the following command:
45+
+
46+
[source,terminal]
47+
----
48+
$ oc delete MachineAutoscaler/<machine_autoscaler_name> -n openshift-machine-api
49+
----
50+
+
51+
.Example output
52+
[source,terminal]
53+
----
54+
machineautoscaler.autoscaling.openshift.io "compute-us-east-1a" deleted
55+
----
56+
57+
.Verification
58+
59+
* To verify that the machine autoscaler is disabled, run the following command:
60+
+
61+
[source,terminal]
62+
----
63+
$ oc get MachineAutoscaler -n openshift-machine-api
64+
----
65+
+
66+
The disabled machine autoscaler does not appear in the list of machine autoscalers.
67+
68+
.Next steps
69+
70+
* If you need to re-enable the machine autoscaler, use the `<machine_autoscaler_name_backup>.yaml` backup file and follow the instructions in "Deploying a machine autoscaler".

modules/deploying-resource.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010

1111
:_content-type: PROCEDURE
1212
[id="{FeatureResourceName}-deploying_{context}"]
13-
= Deploying the {FeatureName}
13+
= Deploying a {FeatureName}
1414

15-
To deploy the {FeatureName}, you create an instance of the `{FeatureResourceName}` resource.
15+
To deploy a {FeatureName}, you create an instance of the `{FeatureResourceName}` resource.
1616

1717
.Procedure
1818

19-
. Create a YAML file for the `{FeatureResourceName}` resource that contains the customized resource definition.
19+
. Create a YAML file for a `{FeatureResourceName}` resource that contains the custom resource definition.
2020

21-
. Create the resource in the cluster:
21+
. Create the custom resource in the cluster by running the following command:
2222
+
2323
[source,terminal]
2424
----
2525
$ oc create -f <filename>.yaml <1>
2626
----
27-
<1> `<filename>` is the name of the resource file that you customized.
27+
<1> `<filename>` is the name of the custom resource file.
2828

2929
// Undefine attributes, so that any mistakes are easily spotted
3030
:!FeatureName:

modules/machine-autoscaler-cr.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
:_content-type: REFERENCE
77
[id="machine-autoscaler-cr_{context}"]
8-
= MachineAutoscaler resource definition
8+
= Machine autoscaler resource definition
99

1010
This `MachineAutoscaler` resource definition shows the parameters and sample values for the machine autoscaler.
1111

0 commit comments

Comments
 (0)