feat: Manage VM identifiers

This commit is contained in:
Peter 2025-10-31 17:24:40 +01:00
parent 66c61fafc9
commit 24b89de734
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
7 changed files with 8 additions and 29 deletions

View file

@ -6,6 +6,7 @@ provider "proxmox" {
locals {
cluster_name = "k8s-wheatley"
vm-id_prefix = 200
kubernetes_version = "1.34.1"
talos_version = "1.11.3"
gateway_api_version = "1.4.0"
@ -95,6 +96,7 @@ module "controlplanes" {
for_each = { for node in local.controlplanes.nodes : node.name => node }
node = {
id = local.vm-id_prefix + tonumber(replace(each.key, "cp", ""))
name = format("k8s-wheatley-%s", each.value.name)
ipv4_address = each.value.ip_address
cpu = local.controlplanes.cpu
@ -112,19 +114,14 @@ module "controlplanes" {
}
}
resource "time_sleep" "delay_before_workers" {
depends_on = [module.talos-image]
create_duration = "1s"
}
module "workers" {
depends_on = [time_sleep.delay_before_workers]
depends_on = [module.talos-image]
source = "./modules/talos-node"
for_each = { for node in local.workers.nodes : node.name => node }
node = {
id = local.vm-id_prefix + 20 + tonumber(replace(each.key, "worker", ""))
name = format("k8s-wheatley-%s", each.value.name)
ipv4_address = each.value.ip_address
cpu = local.workers.cpu