This commit is contained in:
Peter 2025-10-26 11:42:08 +01:00
parent 5def74736b
commit 26be097fda
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
13 changed files with 356 additions and 184 deletions

View file

@ -1,44 +1,63 @@
terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = ">= 3.0.2-rc05"
source = "bpg/proxmox"
version = "0.85.1"
}
}
}
resource "proxmox_vm_qemu" "controlplane" {
for_each = { for node in var.controlplanes.nodes : node.name => node }
name = format("k8s-wheatley-%s", each.value.name)
target_node = "pve01"
tags = "k8s-wheatley,controlplane"
onboot = true
bios = "ovmf"
boot = "order=virtio0;net0"
clone = format("talos-%s", var.controlplanes.talos_version)
scsihw = "virtio-scsi-pci"
resource "proxmox_virtual_environment_vm" "controlplane" {
disk {
size = var.controlplanes.disk
storage = var.controlplanes.storagepool
type = "disk"
slot = "virtio0"
format = "raw"
name = format("k8s-wheatley-%s", var.controlplane.node_name)
node_name = "pve01"
tags = ["k8s-wheatley,controlplane"]
bios = "ovmf"
on_boot = true
machine = "q35"
stop_on_destroy = true
operating_system {
type = "l26"
}
agent {
enabled = true
}
cpu {
cores = var.controlplanes.cpu
cores = var.controlplane.cpu
sockets = 1
type = "host"
}
memory = var.controlplanes.memory * 1024
memory {
dedicated = var.controlplane.memory * 1024
}
network {
id = 0
model = "virtio"
disk {
datastore_id = var.controlplane.storagepool
interface = "virtio0"
size = var.controlplane.disk * 1024
file_format = "raw"
}
initialization {
datastore_id = var.controlplane.storagepool
ip_config {
ipv4 {
address = var.controlplane.node_ipv4_address
gateway = var.controlplane.ipv4_gateway
}
}
dns {
servers = ["10.13.37.2"]
}
}
network_device {
bridge = "vmbr1"
mac_address = var.controlplane.mac_address
}
ipconfig0 = format("ip=%s/24,gw=10.13.38.1", each.value.ip_address)
skip_ipv6 = true
}