Skip to main content

Terraform Variables

Resoueces

The example config file with full comments is available here.

Take care

When you override a config field in a structure, you must provide the others! Otherwise, the not provided field will be deleted. You can copy the example file and modify it.

Common Cloud-init Configuration

VariableDefaultTypeDescription
cloud_init_config.datastore_id"local"stringProxmoxVE datastore ID, you can find it in the ProxmoxVE web UI
cloud_init_config.template.dns_servers[]listList of DNS servers to use (e.g., ["1.1.1.1", "8.8.8.8"] - suggest leave blank and using DNS config on interface instead)
cloud_init_config.template.ssh_public_key""stringSSH public key for authentication
cloud_init_config.template.hashed_password""stringHashed password for the root user (generate with mkpasswd -m sha-512) If you do not need login from noVNC, leave it blank
cloud_init_config.template.packages["qemu-guest-agent", "screen", "htop", "policycoreutils-python-utils"]list(string)Default packages to install on every node
cloud_init_config.template.window_duration"1h"stringAuto reboot window duration of rebootmgr (e.g., "10m" for 10 minuites)
cloud_init_config.template.reboot_strategy.rke2_nodes"best-effort"stringReboot strategy of rebootmgr for RKE2 nodes
cloud_init_config.template.reboot_strategy.lb_nodes"best-effort"stringReboot strategy of rebootmgr for load balancer nodes
cloud_init_config.template.change_repofalseboolDisable default official repo and change to custom
cloud_init_config.template.repo_domain"https://mirrors.bfsu.edu.cn/opensuse"stringCustom openSUSE zypper repository URL
cloud_init_config.template.disable_rebootmgr.rke2_nodestrueboolDisable auto reboot for RKE2 nodes (disable when using kured)
cloud_init_config.template.disable_rebootmgr.lb_nodesfalseboolDisable auto reboot for load balancer nodes
cloud_init_config.template.reboot_slots[17, 18, 19, 20, 21, 22]list(number)Hour time slots for reboot times. (hours in 24h format)
cloud_init_config.template.minute_offsets[0, 15, 30, 45]list(number)Minute time slots for reboot times. Look for the concept document for more info

Network Configuration

Control Plane Nodes

VariableDefaultTypeDescription
cloud_init_controlplane_network_config.network_configs[].interface-stringNetwork interface name (e.g. "ens18")
cloud_init_controlplane_network_config.network_configs[].type-stringInterface type ("dhcp" or "static")
cloud_init_controlplane_network_config.network_configs[].base_ip-stringIPv4 address segment (e.g. "192.168.1.0")
cloud_init_controlplane_network_config.network_configs[].gateway-stringGateway IP address
cloud_init_controlplane_network_config.network_configs[].cidr_netmask24numberNetwork mask in CIDR notation
cloud_init_controlplane_network_config.network_configs[].offset1numberStarting IP offset for VMs
cloud_init_controlplane_network_config.network_configs[].dns_search["lan"]list(string)DNS search domains
cloud_init_controlplane_network_config.network_configs[].dns_nameserver["192.168.1.1"]list(string)DNS servers for interface

Worker Nodes

VariableDefaultTypeDescription
cloud_init_worker_network_config.network_configs[].offset10numberStarting IP offset for worker VMs

The other config variables are same as controlplane nodes.

Load Balancer Nodes

VariableDefaultTypeDescription
cloud_init_loadbalancer_network_config.network_configs[].offset20numberStarting IP offset for LB VMs

The other config variables are same as controlplane nodes.

Proxmox Provider Settings

VariableDefaultTypeDescription
cloud_provider.endpoint""stringProxmox API endpoint (e.g., "https://your-proxmox-server:8006")
cloud_provider.api_token""stringProxmox API token (format: "USER@REALM!TOKENID=UUID")
cloud_provider.insecuretrueboolSkip TLS verification (not recommended for production)
cloud_provider.ssh.agenttrueboolUse SSH agent for provisioning, MUST set true for usage of snippets
cloud_provider.ssh.username""stringSSH username for VM access
cloud_provider.ssh.private_key""stringPath to SSH private key for VM access

VM Hardware Configurations

Resoueces

You can follow the bpg/proxmox documents to configure the hardware settings for your VMs.

For now, the project only provide some essential config parameters. If you need more configurations, please open an issue or create a PR.

Control Plane Nodes

VariableDefaultTypeDescription
controlplane_vm_config.stop_on_destroytrueboolStop VM on destroy
controlplane_vm_config.vm_id_start210numberStarting VM ID
controlplane_vm_config.pool_id""stringProxmox pool ID
controlplane_vm_config.cpu_cores2numberNumber of CPU cores
controlplane_vm_config.cpu_type"x86-64-v2-AES"stringCPU type
controlplane_vm_config.mem_dedicated2048numberDedicated memory in MB
controlplane_vm_config.mem_floating2048numberMinimum memory in MB
controlplane_vm_config.disk_size50numberDisk size in GB
controlplane_vm_config.disk_datastore"local"stringDisk datastore
controlplane_vm_config.network_devices[].bridge"vmbr1_210"stringNetwork bridge
controlplane_vm_config.network_devices[].model"virtio"stringNIC model
controlplane_vm_config.network_devices[].vlan_id100numberVLAN ID
controlplane_vm_config.network_devices[].mtu1000numberMTU size
controlplane_vm_config.network_devices[].firewallfalseboolEnable firewall
controlplane_vm_config.qemu_agent_enabledtrueboolEnable QEMU agent

Worker Nodes

VariableDefaultTypeDescription
worker_vm_config.vm_id_start220numberStarting VM ID
worker_vm_config.mem_dedicated2048numberDedicated memory in MB
worker_vm_config.mem_floating2048numberMinimum memory in MB

The other config variables are same as controlplane nodes.

Load Balancer Nodes

VariableDefaultTypeDescription
loadbalancer_vm_config.vm_id_start200numberStarting VM ID
loadbalancer_vm_config.mem_dedicated2048numberDedicated memory in MB
loadbalancer_vm_config.mem_floating2048numberMinimum memory in MB

The other config variables are same as controlplane nodes.

Package Management

VariableDefaultTypeDescription
rke2_cloud_init_extra_packages["rke2", "rke2-selinux"]list(string)Extra packages add to RKE2 nodes
loadbalancer_cloud_init_extra_packages["haproxy", "keepalived"]list(string)Extra packages add to load balancer nodes

Node Assignment

VariableDefaultTypeDescription
available_nodes{"storage0-pve"="storage0-pve", "compute0-pve"="compute0-pve", "compute1-pve"="compute1-pve"}mapPVE nodes for deployment (uses polling strategy). Key and value MUST same.
vms.controlplane.nodes{"control0"="ktest0.lan", "control1"="ktest1.lan", "control2"="ktest2.lan"}mapControl plane VM names and FQDNs
vms.loadbalancer.nodes{"lb0"="kload0.lan", "lb1"="kload1.lan"}mapLoad balancer VM names and FQDNs
vms.worker.nodes{"worker0"="kworker0.lan"}mapWorker node VM names and FQDNs