Skip to content

Commit

Permalink
Merge pull request #1284 from kube-hetzner/tweak/autoscaler-timeout
Browse files Browse the repository at this point in the history
Tweak autoscaler creation timeout
  • Loading branch information
mysticaltech committed Mar 16, 2024
2 parents 54a6c16 + ece7a6d commit 78f970c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
30 changes: 15 additions & 15 deletions autoscaler-agents.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ locals {
autoscaler_yaml = length(var.autoscaler_nodepools) == 0 ? "" : templatefile(
"${path.module}/templates/autoscaler.yaml.tpl",
{
cloudinit_config = local.isUsingLegacyConfig ? base64encode(data.cloudinit_config.autoscaler_legacy_config[0].rendered) : ""
ca_image = var.cluster_autoscaler_image
ca_version = var.cluster_autoscaler_version
cluster_autoscaler_extra_args = var.cluster_autoscaler_extra_args
cluster_autoscaler_log_level = var.cluster_autoscaler_log_level
cluster_autoscaler_log_to_stderr = var.cluster_autoscaler_log_to_stderr
cluster_autoscaler_stderr_threshold = var.cluster_autoscaler_stderr_threshold
cluster_autoscaler_server_creation_timeout = var.cluster_autoscaler_server_creation_timeout
ssh_key = local.hcloud_ssh_key_id
ipv4_subnet_id = data.hcloud_network.k3s.id
snapshot_id = local.first_nodepool_snapshot_id
cluster_config = base64encode(jsonencode(local.cluster_config))
firewall_id = hcloud_firewall.k3s.id
cluster_name = local.cluster_prefix
node_pools = var.autoscaler_nodepools
cloudinit_config = local.isUsingLegacyConfig ? base64encode(data.cloudinit_config.autoscaler_legacy_config[0].rendered) : ""
ca_image = var.cluster_autoscaler_image
ca_version = var.cluster_autoscaler_version
cluster_autoscaler_extra_args = var.cluster_autoscaler_extra_args
cluster_autoscaler_log_level = var.cluster_autoscaler_log_level
cluster_autoscaler_log_to_stderr = var.cluster_autoscaler_log_to_stderr
cluster_autoscaler_stderr_threshold = var.cluster_autoscaler_stderr_threshold
cluster_autoscaler_server_creation_timeout = tostring(var.cluster_autoscaler_server_creation_timeout)
ssh_key = local.hcloud_ssh_key_id
ipv4_subnet_id = data.hcloud_network.k3s.id
snapshot_id = local.first_nodepool_snapshot_id
cluster_config = base64encode(jsonencode(local.cluster_config))
firewall_id = hcloud_firewall.k3s.id
cluster_name = local.cluster_prefix
node_pools = var.autoscaler_nodepools
})
# A concatenated list of all autoscaled nodes
autoscaled_nodes = length(var.autoscaler_nodepools) == 0 ? {} : {
Expand Down
4 changes: 2 additions & 2 deletions kube.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ module "kube-hetzner" {
# - cluster_autoscaler_stderr_threshold: Sets the threshold for logs that go to stderr (--stderrthreshold).
#
# Server/node creation timeout variable:
# - 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)
# - 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)
#
# Example:
#
Expand All @@ -376,7 +376,7 @@ module "kube-hetzner" {
# cluster_autoscaler_log_level = 4
# cluster_autoscaler_log_to_stderr = true
# cluster_autoscaler_stderr_threshold = "INFO"
# cluster_autoscaler_server_creation_timeout = "5"
# cluster_autoscaler_server_creation_timeout = 15

# Additional Cluster Autoscaler binary configuration
#
Expand Down
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ variable "cluster_autoscaler_extra_args" {
}

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

variable "autoscaler_nodepools" {
Expand All @@ -323,7 +324,7 @@ variable "autoscaler_nodepools" {
max_nodes = number
labels = optional(map(string), {})
kubelet_args = optional(list(string), ["kube-reserved=cpu=50m,memory=300Mi,ephemeral-storage=1Gi", "system-reserved=cpu=250m,memory=300Mi"])
taints = optional(list(object({
taints = optional(list(object({
key = string
value = string
effect = string
Expand Down

0 comments on commit 78f970c

Please sign in to comment.