Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoscaler: Add support to set HCLOUD_SERVER_CREATION_TIMEOUT #1279

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions autoscaler-agents.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {

Check failure on line 1 in autoscaler-agents.tf

View workflow job for this annotation

GitHub Actions / Check formatting of terraform files

File is not in canonical format (terraform fmt)
cluster_prefix = var.use_cluster_name_in_node_name ? "${var.cluster_name}-" : ""
first_nodepool_snapshot_id = length(var.autoscaler_nodepools) == 0 ? "" : (
substr(var.autoscaler_nodepools[0].server_type, 0, 3) == "cax" ? data.hcloud_image.microos_arm_snapshot.id : data.hcloud_image.microos_x86_snapshot.id
Expand Down Expand Up @@ -34,6 +34,7 @@
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