Skip to content

Commit

Permalink
Merge pull request #1279 from UBaggeler/fix/autoscaler-creation-timeout
Browse files Browse the repository at this point in the history
autoscaler: Add support to set HCLOUD_SERVER_CREATION_TIMEOUT
  • Loading branch information
mysticaltech committed Mar 16, 2024
2 parents 5ae0545 + 4d2c5ce commit d88a3d4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions autoscaler-agents.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ locals {
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
Expand Down
4 changes: 4 additions & 0 deletions kube.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,17 @@ module "kube-hetzner" {
# - cluster_autoscaler_log_to_stderr: Determines whether to log to stderr (--logtostderr).
# - 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)
#
# Example:
#
# cluster_autoscaler_image = "registry.k8s.io/autoscaling/cluster-autoscaler"
# cluster_autoscaler_version = "v1.27.3"
# cluster_autoscaler_log_level = 4
# cluster_autoscaler_log_to_stderr = true
# cluster_autoscaler_stderr_threshold = "INFO"
# cluster_autoscaler_server_creation_timeout = "5"

# Additional Cluster Autoscaler binary configuration
#
Expand Down
4 changes: 4 additions & 0 deletions templates/autoscaler.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ spec:
value: '${ipv4_subnet_id}'
- name: HCLOUD_FIREWALL
value: '${firewall_id}'
%{~ if cluster_autoscaler_server_creation_timeout != "" ~}
- name: HCLOUD_SERVER_CREATION_TIMEOUT
value: '${cluster_autoscaler_server_creation_timeout}'
%{~ endif ~}
volumeMounts:
- name: ssl-certs
mountPath: /etc/ssl/certs
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ variable "cluster_autoscaler_extra_args" {
description = "Extra arguments for the Cluster Autoscaler deployment."
}

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)"
}

variable "autoscaler_nodepools" {
description = "Cluster autoscaler nodepools."
type = list(object({
Expand Down

0 comments on commit d88a3d4

Please sign in to comment.