resource "proxmox_vm_qemu" "control_plane" { count = 1 name = "control-plane-${count.index}.k8s.cluster" target_node = "${var.pm_node}" clone = "debian-11-cloudinit-template" os_type = "cloud-init" cores = 2 sockets = "1" cpu = "host" memory = 2048 scsihw = "virtio-scsi-pci" bootdisk = "scsi0" agent = 1 disk { size = "10G" type = "scsi" storage = "local-lvm" iothread = 0 } network { model = "virtio" bridge = "${var.vm_vmbr}" tag = "${var.vm_vlan}" } # cloud-init settings # adjust the ip and gateway addresses as needed ipconfig0 = "ip=${var.vm_plane_control_network}${count.index}/24,gw=${var.vm_gateway}" } resource "proxmox_vm_qemu" "worker_nodes" { count = 3 name = "worker-${count.index}.k8s.cluster" target_node = "${var.pm_node}" clone = "debian-11-cloudinit-template" os_type = "cloud-init" cores = 2 sockets = "1" cpu = "host" memory = 2048 scsihw = "virtio-scsi-pci" bootdisk = "scsi0" agent = 1 disk { size = "10G" type = "scsi" storage = "local-lvm" iothread = 0 } network { model = "virtio" bridge = "${var.vm_vmbr}" tag = "${var.vm_vlan}" } # cloud-init settings # adjust the ip and gateway addresses as needed ipconfig0 = "ip=${var.vm_worker_nodes_network}${count.index}/24,gw=${var.vm_gateway}" } # Generate inventory file resource "local_file" "inventory" { filename = "hosts.ini" content = <