fix(terraform): parameterize worker network interface, use nvme diskSelector instead of raw path, add configurable swap partition support

This commit is contained in:
Story Crater Bot
2026-08-10 22:05:53 -07:00
parent d81c57f860
commit 209df7558e
4 changed files with 29 additions and 10 deletions
+2
View File
@@ -89,6 +89,7 @@ resource "local_file" "worker_configs" {
lan_ip = each.value.lan_ip
lan_subnet = each.value.lan_subnet
lan_gateway = each.value.lan_gateway
network_interface = each.value.network_interface
kubelet_image = local.kubelet_image
cluster_dns_ip = local.cluster_dns_ip
install_disk = each.value.install_disk
@@ -100,6 +101,7 @@ resource "local_file" "worker_configs" {
zone = each.value.zone
gpu_count = each.value.gpu_count
extra_disks = each.value.extra_disks
swap_size = each.value.swap_size
# Cluster config
cluster_id = var.cluster_id
+17 -2
View File
@@ -12,7 +12,7 @@ machine:
network:
hostname: ${hostname}
interfaces:
- interface: eno1
- interface: ${network_interface}
addresses:
- ${lan_ip}/24
routes:
@@ -37,11 +37,15 @@ machine:
- ${cluster_dns_ip}
extraArgs:
rotate-server-certificates: true
extraConfig:
memorySwap:
swapBehavior: LimitedSwap
nodeIP:
validSubnets:
- 192.168.1.0/24
install:
disk: ${install_disk}
diskSelector:
match: disk.transport == "nvme"
image: ${factory_image}
wipe: true
grubUseUKICmdline: true
@@ -93,3 +97,14 @@ cluster:
kubernetes:
disabled: true
service: {}
%{ if swap_size != "" ~}
---
apiVersion: v1alpha1
kind: SwapVolumeConfig
name: swap1
provisioning:
diskSelector:
match: disk.transport == "nvme"
minSize: ${swap_size}
maxSize: ${swap_size}
%{ endif ~}
Binary file not shown.
+10 -8
View File
@@ -123,14 +123,16 @@ variable "controlplane_configs" {
variable "worker_configs" {
type = map(object({
hostname = string
lan_ip = string
lan_subnet = string
lan_gateway = string
install_disk = string
zone = string
gpu_count = optional(number, 0)
factory_image = 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, "")
extra_disks = optional(list(object({
device = string
mountpoint = string