Skip to content

Commit fb612ad

Browse files
authored
Merge pull request #33 from truefoundry/autoscaler-profile-variables
Updated autoscaling profile variables
2 parents 7634369 + 2b36dec commit fb612ad

File tree

3 files changed

+100
-10
lines changed

3 files changed

+100
-10
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ Truefoundry Azure Cluster Module
3535
| Name | Description | Type | Default | Required |
3636
|------|-------------|------|---------|:--------:|
3737
| <a name="input_allowed_ip_ranges"></a> [allowed\_ip\_ranges](#input\_allowed\_ip\_ranges) | Allowed IP ranges to connect to the cluster | `list(string)` | <pre>[<br/> "0.0.0.0/0"<br/>]</pre> | no |
38+
| <a name="input_autoscaler_profile_expander"></a> [autoscaler\_profile\_expander](#input\_autoscaler\_profile\_expander) | Expander for the autoscaler profile. Possible values are `least-waste`, `priority`, `most-pods` and `random`. Defaults to `least-waste` | `string` | `"least-waste"` | no |
39+
| <a name="input_autoscaler_profile_max_graceful_termination_sec"></a> [autoscaler\_profile\_max\_graceful\_termination\_sec](#input\_autoscaler\_profile\_max\_graceful\_termination\_sec) | Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. Defaults to 180 | `number` | `180` | no |
40+
| <a name="input_autoscaler_profile_max_node_provisioning_time"></a> [autoscaler\_profile\_max\_node\_provisioning\_time](#input\_autoscaler\_profile\_max\_node\_provisioning\_time) | Maximum time the autoscaler waits for a node to be provisioned. Defaults to 15 minutes | `string` | `"15m"` | no |
41+
| <a name="input_autoscaler_profile_max_unready_nodes"></a> [autoscaler\_profile\_max\_unready\_nodes](#input\_autoscaler\_profile\_max\_unready\_nodes) | Maximum Number of allowed unready nodes. Defaults to 3 | `number` | `3` | no |
42+
| <a name="input_autoscaler_profile_scale_down_delay_after_add"></a> [autoscaler\_profile\_scale\_down\_delay\_after\_add](#input\_autoscaler\_profile\_scale\_down\_delay\_after\_add) | Scale down delay after add for the autoscaler profile | `string` | `"2m"` | no |
43+
| <a name="input_autoscaler_profile_scale_down_delay_after_delete"></a> [autoscaler\_profile\_scale\_down\_delay\_after\_delete](#input\_autoscaler\_profile\_scale\_down\_delay\_after\_delete) | Scale down delay after delete for the autoscaler profile | `string` | `"30s"` | no |
44+
| <a name="input_autoscaler_profile_scale_down_unneeded"></a> [autoscaler\_profile\_scale\_down\_unneeded](#input\_autoscaler\_profile\_scale\_down\_unneeded) | Scale down unneeded for the autoscaler profile | `string` | `"1m"` | no |
45+
| <a name="input_autoscaler_profile_scale_down_unready"></a> [autoscaler\_profile\_scale\_down\_unready](#input\_autoscaler\_profile\_scale\_down\_unready) | Scale down unready for the autoscaler profile | `string` | `"2m"` | no |
46+
| <a name="input_autoscaler_profile_scale_down_utilization_threshold"></a> [autoscaler\_profile\_scale\_down\_utilization\_threshold](#input\_autoscaler\_profile\_scale\_down\_utilization\_threshold) | Scale down utilization threshold for the autoscaler profile | `number` | `0.7` | no |
47+
| <a name="input_autoscaler_profile_skip_nodes_with_local_storage"></a> [autoscaler\_profile\_skip\_nodes\_with\_local\_storage](#input\_autoscaler\_profile\_skip\_nodes\_with\_local\_storage) | Skip nodes with pods with local storage, for example, EmptyDir or HostPath | `bool` | `false` | no |
48+
| <a name="input_autoscaler_profile_skip_nodes_with_system_pods"></a> [autoscaler\_profile\_skip\_nodes\_with\_system\_pods](#input\_autoscaler\_profile\_skip\_nodes\_with\_system\_pods) | Skip nodes with system pods for the autoscaler profile | `bool` | `true` | no |
3849
| <a name="input_cluster_autoscaler_diagnostic_enable_override"></a> [cluster\_autoscaler\_diagnostic\_enable\_override](#input\_cluster\_autoscaler\_diagnostic\_enable\_override) | Enable overriding of the cluster autoscaler diagnostic setting name. | `bool` | `false` | no |
3950
| <a name="input_cluster_autoscaler_diagnostic_override_name"></a> [cluster\_autoscaler\_diagnostic\_override\_name](#input\_cluster\_autoscaler\_diagnostic\_override\_name) | Cluster autoscaler diagnostic setting name. Default is '<cluster-name>-cluster-autoscaler' | `string` | `""` | no |
4051
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Whether the cluster is control plane | `bool` | n/a | yes |
@@ -45,6 +56,7 @@ Truefoundry Azure Cluster Module
4556
| <a name="input_disk_driver_version"></a> [disk\_driver\_version](#input\_disk\_driver\_version) | Version of disk driver. Supported values `v1` and `v2` | `string` | `"v1"` | no |
4657
| <a name="input_disk_size"></a> [disk\_size](#input\_disk\_size) | Disk size of the initial node pool in GB | `string` | `"100"` | no |
4758
| <a name="input_dns_ip"></a> [dns\_ip](#input\_dns\_ip) | IP from service CIDR used for internal DNS | `string` | `"10.255.0.10"` | no |
59+
| <a name="input_enable_autoscaler_profile"></a> [enable\_autoscaler\_profile](#input\_enable\_autoscaler\_profile) | Enable autoscaler profile for the cluster | `bool` | `true` | no |
4860
| <a name="input_enable_blob_driver"></a> [enable\_blob\_driver](#input\_enable\_blob\_driver) | Enable blob storage provider | `bool` | `true` | no |
4961
| <a name="input_enable_disk_driver"></a> [enable\_disk\_driver](#input\_enable\_disk\_driver) | Enable disk storage provider | `bool` | `true` | no |
5062
| <a name="input_enable_file_driver"></a> [enable\_file\_driver](#input\_enable\_file\_driver) | Enable file storage provider | `bool` | `true` | no |

aks.tf

+12-10
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ module "aks" {
4040
orchestrator_version = var.orchestrator_version
4141

4242
# autoscaler configuration
43-
auto_scaler_profile_enabled = true
44-
auto_scaler_profile_expander = "random"
45-
auto_scaler_profile_max_graceful_termination_sec = "180"
46-
auto_scaler_profile_max_node_provisioning_time = "5m"
47-
auto_scaler_profile_max_unready_nodes = 0
48-
auto_scaler_profile_scale_down_delay_after_add = "2m"
49-
auto_scaler_profile_scale_down_delay_after_delete = "30s"
50-
auto_scaler_profile_scale_down_unneeded = "1m"
51-
auto_scaler_profile_scale_down_unready = "2m"
52-
auto_scaler_profile_scale_down_utilization_threshold = "0.3"
43+
auto_scaler_profile_enabled = var.enable_autoscaler_profile
44+
auto_scaler_profile_expander = var.autoscaler_profile_expander
45+
auto_scaler_profile_max_graceful_termination_sec = var.autoscaler_profile_max_graceful_termination_sec
46+
auto_scaler_profile_max_node_provisioning_time = var.autoscaler_profile_max_node_provisioning_time
47+
auto_scaler_profile_max_unready_nodes = var.autoscaler_profile_max_unready_nodes
48+
auto_scaler_profile_scale_down_delay_after_add = var.autoscaler_profile_scale_down_delay_after_add
49+
auto_scaler_profile_scale_down_delay_after_delete = var.autoscaler_profile_scale_down_delay_after_delete
50+
auto_scaler_profile_scale_down_unneeded = var.autoscaler_profile_scale_down_unneeded
51+
auto_scaler_profile_scale_down_unready = var.autoscaler_profile_scale_down_unready
52+
auto_scaler_profile_scale_down_utilization_threshold = var.autoscaler_profile_scale_down_utilization_threshold
53+
auto_scaler_profile_skip_nodes_with_system_pods = var.autoscaler_profile_skip_nodes_with_system_pods
54+
auto_scaler_profile_skip_nodes_with_local_storage = var.autoscaler_profile_skip_nodes_with_local_storage
5355

5456
# cluster level configurations
5557
api_server_authorized_ip_ranges = var.allowed_ip_ranges

variables.tf

+76
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,82 @@ variable "max_pods_per_node" {
223223
default = 32
224224
}
225225

226+
################################################################################
227+
# Autoscaling configurations
228+
################################################################################
229+
230+
variable "enable_autoscaler_profile" {
231+
description = "Enable autoscaler profile for the cluster"
232+
type = bool
233+
default = true
234+
}
235+
236+
variable "autoscaler_profile_expander" {
237+
description = "Expander for the autoscaler profile. Possible values are `least-waste`, `priority`, `most-pods` and `random`. Defaults to `least-waste`"
238+
type = string
239+
default = "least-waste"
240+
}
241+
242+
variable "autoscaler_profile_max_graceful_termination_sec" {
243+
description = "Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. Defaults to 180"
244+
type = number
245+
default = 180
246+
}
247+
248+
variable "autoscaler_profile_max_node_provisioning_time" {
249+
description = "Maximum time the autoscaler waits for a node to be provisioned. Defaults to 15 minutes"
250+
type = string
251+
default = "15m"
252+
}
253+
254+
variable "autoscaler_profile_max_unready_nodes" {
255+
description = "Maximum Number of allowed unready nodes. Defaults to 3"
256+
type = number
257+
default = 3
258+
}
259+
260+
variable "autoscaler_profile_scale_down_delay_after_add" {
261+
description = "Scale down delay after add for the autoscaler profile"
262+
type = string
263+
default = "2m"
264+
}
265+
266+
variable "autoscaler_profile_scale_down_delay_after_delete" {
267+
description = "Scale down delay after delete for the autoscaler profile"
268+
type = string
269+
default = "30s"
270+
}
271+
272+
variable "autoscaler_profile_scale_down_unneeded" {
273+
description = "Scale down unneeded for the autoscaler profile"
274+
type = string
275+
default = "1m"
276+
}
277+
278+
variable "autoscaler_profile_scale_down_unready" {
279+
description = "Scale down unready for the autoscaler profile"
280+
type = string
281+
default = "2m"
282+
}
283+
284+
variable "autoscaler_profile_scale_down_utilization_threshold" {
285+
description = "Scale down utilization threshold for the autoscaler profile"
286+
type = number
287+
default = 0.7
288+
}
289+
290+
variable "autoscaler_profile_skip_nodes_with_system_pods" {
291+
description = "Skip nodes with system pods for the autoscaler profile"
292+
type = bool
293+
default = true
294+
}
295+
296+
variable "autoscaler_profile_skip_nodes_with_local_storage" {
297+
description = "Skip nodes with pods with local storage, for example, EmptyDir or HostPath"
298+
type = bool
299+
default = false
300+
}
301+
226302
################################################################################
227303
# Network
228304
################################################################################

0 commit comments

Comments
 (0)