Example: mixed-proxmox-hetzner
terraform/examples/mixed-proxmox-hetzner is the split pattern. Each front
door runs with manage_platform = false and only builds machines, as page 01
did. The root then calls modules/core itself once, over the two node lists
joined together, and core forms one cluster across both substrates.
What differs
Section titled “What differs”- Two module calls,
cloudonmodules/shc/hetznerandhomeonmodules/shc/proxmox, bothmanage_platform = false. The Hetzner node has a public plane and opens UDP 4244 for mesh0; the Proxmox VMs have static addresses on a flat LAN. - A third call,
core, takesnodes = concat(module.cloud.nodes, module.home.nodes). The first entry of that list is the bootstrap node, so the Hetzner node runsshc initand the home nodes join it across the internet over mesh0. Every node is merged withcontrol_plane = true, so the three nodes are the control plane and its three voters. coretakes the samessh,bootstrapandtopologythe front doors forward when they manage the platform themselves.- The Hetzner front door mints its node’s SSH host key and hands the pin on
in
nodes. Proxmox’s own cloud-init cannot install a host key, so the home VMs’ keys are not known:insecure_ignore_host_key = truelets those through unchecked, and the Hetzner node is still checked.
module "cloud" { source = "../../modules/shc/hetzner" manage_platform = false node_groups = { bootstrap = { count = 1, server_type = var.server_type, runtime = "docker" } } networking = { private = false } firewall = { public_ports = [{ port = "4244", protocol = "udp" }] }}
module "home" { source = "../../modules/shc/proxmox" manage_platform = false node_groups = { home = { count = var.node_count_home, runtime = "docker", static_ips = var.static_ips } }}
module "core" { source = "../../modules/core" nodes = [for n in concat(module.cloud.nodes, module.home.nodes) : merge(n, { control_plane = true })] ssh = { user = "admin", private_key_path = var.ssh_private_key_path, insecure_ignore_host_key = true } bootstrap = { package = { version = var.shc_version } vault_password = var.vault_pw host = var.shc_host } topology = { kind = "wan" }}Running it
Section titled “Running it”HCLOUD_TOKEN for Hetzner and the Proxmox provider’s own variables,
PM_API_URL, PM_API_TOKEN_ID, PM_API_TOKEN_SECRET and PM_TLS_INSECURE,
come from the environment. The tfvars names the Proxmox node, template,
storage, bridge, gateway and the static addresses of the home VMs.
cp learn/shc/terraform/examples/mixed-proxmox-hetzner/terraform.tfvars.example learn/shc/terraform/examples/mixed-proxmox-hetzner/terraform.tfvarstofu -chdir=learn/shc/terraform/examples/mixed-proxmox-hetzner inittofu -chdir=learn/shc/terraform/examples/mixed-proxmox-hetzner applytofu -chdir=learn/shc/terraform/examples/mixed-proxmox-hetzner destroyThis page was not walked: it needs a Proxmox host.
Next: Example: proxmox-lan.
shc@docs:~$