You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After you deploy the cluster autoscaler, deploy `MachineAutoscaler` resources that reference the compute machine sets that are used to scale the cluster.
42
44
@@ -50,7 +52,7 @@ You must deploy at least one `MachineAutoscaler` resource after you deploy the `
50
52
You must configure separate resources for each compute machine set. Remember that compute machine sets are different in each region, so consider whether you want to enable machine scaling in multiple regions. The compute machine set that you scale must have at least one machine in it.
= Configuring a priority expander for the cluster autoscaler
8
+
9
+
When the cluster autoscaler uses the priority expander, it scales up by using the machine set with the highest user-assigned priority.
10
+
To use this expander, you must create a config map that defines the priority of your machine sets.
11
+
12
+
For each specified priority level, you must create regular expressions to identify machine sets that you want to use when prioritizing a machine set for selection.
13
+
The regular expressions must match the name of any compute machine set that you want the cluster autoscaler to consider for selection.
14
+
15
+
.Prerequisites
16
+
17
+
* You have deployed an {product-title} cluster that uses the Machine API.
18
+
* You have access to the cluster using an account with `cluster-admin` permissions.
19
+
* You have installed the {oc-first}.
20
+
21
+
.Procedure
22
+
23
+
. List the compute machine sets on your cluster by running the following command:
Copy file name to clipboardExpand all lines: modules/cluster-autoscaler-cr.adoc
+41-20Lines changed: 41 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -9,38 +9,38 @@
9
9
10
10
This `ClusterAutoscaler` resource definition shows the parameters and sample values for the cluster autoscaler.
11
11
12
-
13
12
[source,yaml]
14
13
----
15
14
apiVersion: "autoscaling.openshift.io/v1"
16
15
kind: "ClusterAutoscaler"
17
16
metadata:
18
17
name: "default"
19
18
spec:
20
-
podPriorityThreshold: -10 <1>
19
+
podPriorityThreshold: -10 # <1>
21
20
resourceLimits:
22
-
maxNodesTotal: 24 <2>
21
+
maxNodesTotal: 24 # <2>
23
22
cores:
24
-
min: 8 <3>
25
-
max: 128 <4>
23
+
min: 8 # <3>
24
+
max: 128 # <4>
26
25
memory:
27
-
min: 4 <5>
28
-
max: 256 <6>
26
+
min: 4 # <5>
27
+
max: 256 # <6>
29
28
gpus:
30
-
- type: nvidia.com/gpu <7>
31
-
min: 0 <8>
32
-
max: 16 <9>
29
+
- type: nvidia.com/gpu # <7>
30
+
min: 0 # <8>
31
+
max: 16 # <9>
33
32
- type: amd.com/gpu
34
33
min: 0
35
34
max: 4
36
-
logVerbosity: 4 <10>
37
-
scaleDown: <11>
38
-
enabled: true <12>
39
-
delayAfterAdd: 10m <13>
40
-
delayAfterDelete: 5m <14>
41
-
delayAfterFailure: 30s <15>
42
-
unneededTime: 5m <16>
43
-
utilizationThreshold: "0.4" <17>
35
+
logVerbosity: 4 # <10>
36
+
scaleDown: # <11>
37
+
enabled: true # <12>
38
+
delayAfterAdd: 10m # <13>
39
+
delayAfterDelete: 5m # <14>
40
+
delayAfterFailure: 30s # <15>
41
+
unneededTime: 5m # <16>
42
+
utilizationThreshold: "0.4" # <17>
43
+
expanders: ["Random"] # <18>
44
44
----
45
45
<1> Specify the priority that a pod must exceed to cause the cluster autoscaler to deploy additional nodes. Enter a 32-bit integer value. The `podPriorityThreshold` value is compared to the value of the `PriorityClass` that you assign to each pod.
46
46
<2> Specify the maximum number of nodes to deploy. This value is the total number of machines that are deployed in your cluster, not just the ones that the autoscaler controls. Ensure that this value is large enough to account for all of your control plane and compute machines and the total number of replicas that you specify in your `MachineAutoscaler` resources.
@@ -66,8 +66,29 @@ If you do not specify a value, the default value of `1` is used.
66
66
<14> Optional: Specify the period to wait before deleting a node after a node has recently been _deleted_. If you do not specify a value, the default value of `0s` is used.
67
67
<15> Optional: Specify the period to wait before deleting a node after a scale down failure occurred. If you do not specify a value, the default value of `3m` is used.
68
68
<16> Optional: Specify a period of time before an unnecessary node is eligible for deletion. If you do not specify a value, the default value of `10m` is used.
69
-
<17> Optional: Specify the _node utilization level_. Nodes below this utilization level are eligible for deletion. If you do not specify a value, the default value of `10m` is used.. The node utilization level is the sum of the requested resources divided by the allocated resources for the node, and must be a value greater than `"0"` but less than `"1"`. If you do not specify a value, the cluster autoscaler uses a default value of `"0.5"`, which corresponds to 50% utilization. This value must be expressed as a string.
70
-
// Might be able to add a formula to show this visually, but need to look into asciidoc math formatting and what our tooling supports.
69
+
<17> Optional: Specify the _node utilization level_. Nodes below this utilization level are eligible for deletion. If you do not specify a value, the default value of `10m` is used.
70
+
+
71
+
The node utilization level is the sum of the requested resources divided by the allocated resources for the node, and must be a value greater than `"0"` but less than `"1"`. If you do not specify a value, the cluster autoscaler uses a default value of `"0.5"`, which corresponds to 50% utilization. You must express this value as a string.
72
+
<18> Optional: Specify any expanders that you want the cluster autoscaler to use.
73
+
The following values are valid:
74
+
+
75
+
--
76
+
* `LeastWaste`: Selects the machine set that minimizes the idle CPU after scaling.
77
+
If multiple machine sets would yield the same amount of idle CPU, the selection minimizes unused memory.
78
+
* `Priority`: Selects the machine set with the highest user-assigned priority.
79
+
To use this expander, you must create a config map that defines the priority of your machine sets.
80
+
For more information, see "Configuring a priority expander for the cluster autoscaler."
81
+
* `Random`: (Default) Selects the machine set randomly.
82
+
--
83
+
+
84
+
If you do not specify a value, the default value of `Random` is used.
85
+
+
86
+
You can specify multiple expanders by using the `[LeastWaste, Priority]` format.
87
+
The cluster autoscaler applies each expander according to the specified order.
88
+
+
89
+
In the `[LeastWaste, Priority]` example, the cluster autoscaler first evaluates according to the `LeastWaste` criteria.
90
+
If more than one machine set satisfies the `LeastWaste` criteria equally well, the cluster autoscaler then evaluates according to the `Priority` criteria.
91
+
If more than one machine set satisfies all of the specified expanders equally well, the cluster autoscaler selects one to use at random.
0 commit comments