Skip to content
SHC Docs

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.

  • modules/shc/proxmox takes what a VM needs: proxmox_node, template_name, storage, cloudinit_storage, vmid_base, cores, memory, disk_size, the network_bridge and MTU, the gateway, nameservers and searchdomain.
  • A node group carries static_ips, one address per VM, in place of a server type and a region. The module hands core a node list whose public address is null: a LAN cluster is not internet-reachable, and that null is how the platform knows.
  • bootstrap is the same block as everywhere else. The provider’s SSH engine installs shc by apt at package.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 }
}
}

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.

Terminal window
cp learn/shc/terraform/examples/proxmox-lan/terraform.tfvars.example learn/shc/terraform/examples/proxmox-lan/terraform.tfvars
tofu -chdir=learn/shc/terraform/examples/proxmox-lan init
tofu -chdir=learn/shc/terraform/examples/proxmox-lan apply
tofu -chdir=learn/shc/terraform/examples/proxmox-lan destroy

This page was not walked: it needs a Proxmox host.

Next: Example: aws-shc.