diff --git a/infra/live/production/kapsule/terragrunt.hcl b/infra/live/production/kapsule/terragrunt.hcl index c6f2fb39d..afd7205b0 100644 --- a/infra/live/production/kapsule/terragrunt.hcl +++ b/infra/live/production/kapsule/terragrunt.hcl @@ -9,7 +9,8 @@ terraform { inputs = { cluster_name = "foxhunt" k8s_version = "1.34" - always_on_type = "DEV1-M" + always_on_type = "DEV1-M" + always_on_max_size = 2 # GitLab CE pool (dedicated for GitLab + Prometheus + Runner manager) enable_gitlab_pool = true diff --git a/infra/modules/kapsule/main.tf b/infra/modules/kapsule/main.tf index d4ec2a2cc..ea13ad4d3 100644 --- a/infra/modules/kapsule/main.tf +++ b/infra/modules/kapsule/main.tf @@ -32,11 +32,15 @@ resource "scaleway_k8s_pool" "always_on" { node_type = var.always_on_type size = 1 min_size = 1 - max_size = 1 - autoscaling = false + max_size = var.always_on_max_size + autoscaling = true autohealing = true public_ip_disabled = var.public_ip_disabled region = var.region + + lifecycle { + ignore_changes = [size] + } } # GitLab CE node pool (dedicated DEV1-L for GitLab + Runner manager) diff --git a/infra/modules/kapsule/variables.tf b/infra/modules/kapsule/variables.tf index 1b1f958a0..9262b2dce 100644 --- a/infra/modules/kapsule/variables.tf +++ b/infra/modules/kapsule/variables.tf @@ -21,6 +21,12 @@ variable "always_on_type" { default = "DEV1-M" } +variable "always_on_max_size" { + description = "Maximum number of nodes in the always-on pool (autoscaling)" + type = number + default = 2 +} + variable "enable_gitlab_pool" { description = "Create dedicated node pool for GitLab CE" type = bool