Skip to content

Commit 78f970c

Browse files
authored
Merge pull request #1284 from kube-hetzner/tweak/autoscaler-timeout
Tweak autoscaler creation timeout
2 parents 54a6c16 + ece7a6d commit 78f970c

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

autoscaler-agents.tf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ locals {
2727
autoscaler_yaml = length(var.autoscaler_nodepools) == 0 ? "" : templatefile(
2828
"${path.module}/templates/autoscaler.yaml.tpl",
2929
{
30-
cloudinit_config = local.isUsingLegacyConfig ? base64encode(data.cloudinit_config.autoscaler_legacy_config[0].rendered) : ""
31-
ca_image = var.cluster_autoscaler_image
32-
ca_version = var.cluster_autoscaler_version
33-
cluster_autoscaler_extra_args = var.cluster_autoscaler_extra_args
34-
cluster_autoscaler_log_level = var.cluster_autoscaler_log_level
35-
cluster_autoscaler_log_to_stderr = var.cluster_autoscaler_log_to_stderr
36-
cluster_autoscaler_stderr_threshold = var.cluster_autoscaler_stderr_threshold
37-
cluster_autoscaler_server_creation_timeout = var.cluster_autoscaler_server_creation_timeout
38-
ssh_key = local.hcloud_ssh_key_id
39-
ipv4_subnet_id = data.hcloud_network.k3s.id
40-
snapshot_id = local.first_nodepool_snapshot_id
41-
cluster_config = base64encode(jsonencode(local.cluster_config))
42-
firewall_id = hcloud_firewall.k3s.id
43-
cluster_name = local.cluster_prefix
44-
node_pools = var.autoscaler_nodepools
30+
cloudinit_config = local.isUsingLegacyConfig ? base64encode(data.cloudinit_config.autoscaler_legacy_config[0].rendered) : ""
31+
ca_image = var.cluster_autoscaler_image
32+
ca_version = var.cluster_autoscaler_version
33+
cluster_autoscaler_extra_args = var.cluster_autoscaler_extra_args
34+
cluster_autoscaler_log_level = var.cluster_autoscaler_log_level
35+
cluster_autoscaler_log_to_stderr = var.cluster_autoscaler_log_to_stderr
36+
cluster_autoscaler_stderr_threshold = var.cluster_autoscaler_stderr_threshold
37+
cluster_autoscaler_server_creation_timeout = tostring(var.cluster_autoscaler_server_creation_timeout)
38+
ssh_key = local.hcloud_ssh_key_id
39+
ipv4_subnet_id = data.hcloud_network.k3s.id
40+
snapshot_id = local.first_nodepool_snapshot_id
41+
cluster_config = base64encode(jsonencode(local.cluster_config))
42+
firewall_id = hcloud_firewall.k3s.id
43+
cluster_name = local.cluster_prefix
44+
node_pools = var.autoscaler_nodepools
4545
})
4646
# A concatenated list of all autoscaled nodes
4747
autoscaled_nodes = length(var.autoscaler_nodepools) == 0 ? {} : {

kube.tf.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ module "kube-hetzner" {
367367
# - cluster_autoscaler_stderr_threshold: Sets the threshold for logs that go to stderr (--stderrthreshold).
368368
#
369369
# Server/node creation timeout variable:
370-
# - cluster_autoscaler_server_creation_timeout: Sets the timeout (in minutes) until which a newly created server/node has to come available before giving up and destroying it (defaults to 5min)
370+
# - cluster_autoscaler_server_creation_timeout: Sets the timeout (in minutes) until which a newly created server/node has to become available before giving up and destroying it (defaults to 15, unit is minutes)
371371
#
372372
# Example:
373373
#
@@ -376,7 +376,7 @@ module "kube-hetzner" {
376376
# cluster_autoscaler_log_level = 4
377377
# cluster_autoscaler_log_to_stderr = true
378378
# cluster_autoscaler_stderr_threshold = "INFO"
379-
# cluster_autoscaler_server_creation_timeout = "5"
379+
# cluster_autoscaler_server_creation_timeout = 15
380380

381381
# Additional Cluster Autoscaler binary configuration
382382
#

variables.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ variable "cluster_autoscaler_extra_args" {
309309
}
310310

311311
variable "cluster_autoscaler_server_creation_timeout" {
312-
type = string
313-
description = "Timeout (in minutes) until which a newly created server/node has to come available before giving up and destroying it (defaults to 5min)"
312+
type = number
313+
default = 15
314+
description = "Timeout (in minutes) until which a newly created server/node has to become available before giving up and destroying it."
314315
}
315316

316317
variable "autoscaler_nodepools" {
@@ -323,7 +324,7 @@ variable "autoscaler_nodepools" {
323324
max_nodes = number
324325
labels = optional(map(string), {})
325326
kubelet_args = optional(list(string), ["kube-reserved=cpu=50m,memory=300Mi,ephemeral-storage=1Gi", "system-reserved=cpu=250m,memory=300Mi"])
326-
taints = optional(list(object({
327+
taints = optional(list(object({
327328
key = string
328329
value = string
329330
effect = string

0 commit comments

Comments
 (0)