Skip to content
SHC Docs

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.

  • Two module calls, cloud on modules/shc/hetzner and home on modules/shc/proxmox, both manage_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, takes nodes = concat(module.cloud.nodes, module.home.nodes). The first entry of that list is the bootstrap node, so the Hetzner node runs shc init and the home nodes join it across the internet over mesh0. Every node is merged with control_plane = true, so the three nodes are the control plane and its three voters.
  • core takes the same ssh, bootstrap and topology the 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 = true lets 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" }
}

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.

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

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

Next: Example: proxmox-lan.