Some checks failed
Terraform Plan / Terraform Plan (push) Failing after 9s
Provision 3 thin control planes and 3 workers with role-specific sizing and VMID ranges (701/711), generate per-node cloud-init snippets with SSH key injection, and add NixOS kubeadm host/module scaffolding for cp-1..3 and wk-1..3.
115 lines
2.1 KiB
HCL
115 lines
2.1 KiB
HCL
terraform {
|
|
backend "s3" {}
|
|
|
|
required_providers {
|
|
proxmox = {
|
|
source = "Telmate/proxmox"
|
|
version = "3.0.2-rc07"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "proxmox" {
|
|
pm_api_url = var.pm_api_url
|
|
pm_api_token_id = var.pm_api_token_id
|
|
pm_api_token_secret = var.pm_api_token_secret
|
|
pm_tls_insecure = true
|
|
}
|
|
|
|
resource "proxmox_vm_qemu" "control_planes" {
|
|
count = var.control_plane_count
|
|
name = "cp-${count.index + 1}"
|
|
vmid = var.control_plane_vmid_start + count.index
|
|
target_node = var.target_node
|
|
clone = var.clone_template
|
|
full_clone = true
|
|
os_type = "cloud-init"
|
|
agent = 1
|
|
|
|
cpu {
|
|
sockets = 1
|
|
cores = var.control_plane_cores
|
|
}
|
|
memory = var.control_plane_memory_mb
|
|
scsihw = "virtio-scsi-pci"
|
|
boot = "order=scsi0"
|
|
bootdisk = "scsi0"
|
|
ipconfig0 = "ip=dhcp"
|
|
cicustom = "user=local:snippets/cp-${count.index + 1}.yaml"
|
|
|
|
|
|
disks {
|
|
scsi {
|
|
scsi0 {
|
|
disk {
|
|
size = var.control_plane_disk_size
|
|
storage = var.storage
|
|
}
|
|
}
|
|
}
|
|
|
|
ide {
|
|
ide2 {
|
|
cloudinit {
|
|
storage = var.storage
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
network {
|
|
id = 0
|
|
model = "virtio"
|
|
bridge = var.bridge
|
|
}
|
|
}
|
|
|
|
|
|
resource "proxmox_vm_qemu" "workers" {
|
|
count = var.worker_count
|
|
name = "wk-${count.index + 1}"
|
|
vmid = var.worker_vmid_start + count.index
|
|
target_node = var.target_node
|
|
clone = var.clone_template
|
|
full_clone = true
|
|
os_type = "cloud-init"
|
|
agent = 1
|
|
|
|
cpu {
|
|
sockets = 1
|
|
cores = var.worker_cores[count.index]
|
|
}
|
|
memory = var.worker_memory_mb[count.index]
|
|
scsihw = "virtio-scsi-pci"
|
|
boot = "order=scsi0"
|
|
bootdisk = "scsi0"
|
|
ipconfig0 = "ip=dhcp"
|
|
cicustom = "user=local:snippets/wk-${count.index + 1}.yaml"
|
|
|
|
disks {
|
|
scsi {
|
|
scsi0 {
|
|
disk {
|
|
size = var.worker_disk_size
|
|
storage = var.storage
|
|
}
|
|
}
|
|
}
|
|
|
|
ide {
|
|
ide2 {
|
|
cloudinit {
|
|
storage = var.storage
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
network {
|
|
id = 0
|
|
model = "virtio"
|
|
bridge = var.bridge
|
|
}
|
|
}
|