From 3f5d44d6fa254646593e0e6412b94dd4bf98d4bf Mon Sep 17 00:00:00 2001 From: Story Crater Bot <19826264+Riotpiaole@users.noreply.github.com> Date: Mon, 10 Aug 2026 22:22:20 -0700 Subject: [PATCH] fix(terraform): cap EPHEMERAL volume size to reserve disk space for swap partition on worker nodes --- terraform/main.tf | 1 + terraform/templates/worker.tftpl | 12 ++++++++++-- terraform/variables.tf | 21 +++++++++++---------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index 51339e8..f4d5a8e 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -102,6 +102,7 @@ resource "local_file" "worker_configs" { gpu_count = each.value.gpu_count extra_disks = each.value.extra_disks swap_size = each.value.swap_size + ephemeral_max_size = each.value.ephemeral_max_size # Cluster config cluster_id = var.cluster_id diff --git a/terraform/templates/worker.tftpl b/terraform/templates/worker.tftpl index 323a826..35f18bd 100644 --- a/terraform/templates/worker.tftpl +++ b/terraform/templates/worker.tftpl @@ -44,8 +44,7 @@ machine: validSubnets: - 192.168.1.0/24 install: - diskSelector: - match: disk.transport == "nvme" + disk: ${install_disk} image: ${factory_image} wipe: true grubUseUKICmdline: true @@ -100,6 +99,15 @@ cluster: %{ if swap_size != "" ~} --- apiVersion: v1alpha1 +kind: VolumeConfig +name: EPHEMERAL +provisioning: + diskSelector: + match: disk.transport == "nvme" + maxSize: ${ephemeral_max_size} + grow: false +--- +apiVersion: v1alpha1 kind: SwapVolumeConfig name: swap1 provisioning: diff --git a/terraform/variables.tf b/terraform/variables.tf index 87f6b27..45aa573 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -123,16 +123,17 @@ variable "controlplane_configs" { variable "worker_configs" { type = map(object({ - hostname = string - lan_ip = string - lan_subnet = string - lan_gateway = string - install_disk = string - network_interface = optional(string, "eno1") - zone = string - gpu_count = optional(number, 0) - factory_image = optional(string) - swap_size = optional(string, "") + hostname = string + lan_ip = string + lan_subnet = string + lan_gateway = string + install_disk = string + network_interface = optional(string, "eno1") + zone = string + gpu_count = optional(number, 0) + factory_image = optional(string) + swap_size = optional(string, "") + ephemeral_max_size = optional(string, "700GiB") extra_disks = optional(list(object({ device = string mountpoint = string