feat: Manage storage nic config through machineconfig

This commit is contained in:
Peter 2025-12-15 18:23:22 +01:00
parent 30d3b3b478
commit 628443c06c
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
4 changed files with 28 additions and 14 deletions

View file

@ -70,14 +70,17 @@ locals {
{
name = "worker01"
ip_address = "10.13.37.21"
storage_address = "10.0.69.21"
},
{
name = "worker02"
ip_address = "10.13.37.22"
storage_address = "10.0.69.22"
},
{
name = "worker03"
ip_address = "10.13.37.23"
storage_address = "10.0.69.23"
},
]
}
@ -166,6 +169,7 @@ module "talos-bootstrap" {
name = format("k8s-wheatley-%s", node.name)
type = "worker"
ipv4_address = node.ip_address
storage_address = node.storage_address
pvc_disks = local.workers.pvc_disks
}
]

View file

@ -78,6 +78,7 @@ resource "talos_machine_configuration_apply" "config_apply_worker" {
cluster_name = var.node_config.cluster_name
vip_address = var.node_config.cluster_endpoint
node_name = format("%s.wheatley.in", var.node_config.proxmox_node)
storage_address = each.value.storage_address
machine_type = each.value.type
talos_version = var.node_config.talos_version
gateway-api_version = var.node_config.gateway_api_version

View file

@ -8,6 +8,14 @@ machine:
hostname: ${hostname}
nameservers:
- 9.9.9.9
%{ if storage_address != false ~}
interfaces:
- interface: eth1
mtu: 9000
dhcp: false
addresses:
- ${storage_address}/24
%{ endif ~}
kubelet:
extraArgs:
pod-max-pids: 1000

View file

@ -20,6 +20,7 @@ variable "talos_nodes" {
name = string
type = string
ipv4_address = string
storage_address = optional(string)
pvc_disks = optional(list(number)),
}))
}