Example: proxmox-lan
terraform/examples/proxmox-lan builds the whole cluster on one Proxmox
host: VMs cloned from a template, static addresses on one bridge, the plane
on the single virtio interface. There is no cloud provider token; the
Proxmox API is the substrate.
What differs
Section titled “What differs”modules/shc/proxmoxtakes what a VM needs:proxmox_node,template_name,storage,cloudinit_storage,vmid_base,cores,memory,disk_size, thenetwork_bridgeand MTU, thegateway,nameserversandsearchdomain.- A node group carries
static_ips, one address per VM, in place of a server type and a region. The module handscorea node list whosepublicaddress is null: a LAN cluster is not internet-reachable, and that null is how the platform knows. bootstrapis the same block as everywhere else. The provider’s SSH engine installs shc by apt atpackage.version; the module’s cloud-init drive carries only the addresses and the keys.
module "shc" { source = "../../modules/shc/proxmox"
proxmox_node = var.proxmox_node template_name = var.template_name storage = var.storage cloudinit_storage = var.cloudinit_storage vmid_base = var.vmid_base cores = var.cores memory = var.memory disk_size = var.disk_size network_bridge = var.network_bridge gateway = var.gateway nameservers = var.nameservers nic_name = var.nic
node_groups = { nodes = { count = var.node_count, runtime = var.runtime, static_ips = var.static_ips, control_plane = true } }}Running it
Section titled “Running it”PM_API_URL, PM_API_TOKEN_ID, PM_API_TOKEN_SECRET and PM_TLS_INSECURE
come from the environment. The tfvars names the host, the template and the
addresses.
cp learn/shc/terraform/examples/proxmox-lan/terraform.tfvars.example learn/shc/terraform/examples/proxmox-lan/terraform.tfvarstofu -chdir=learn/shc/terraform/examples/proxmox-lan inittofu -chdir=learn/shc/terraform/examples/proxmox-lan applytofu -chdir=learn/shc/terraform/examples/proxmox-lan destroyThis page was not walked: it needs a Proxmox host.
Next: Example: aws-shc.
shc@docs:~$