2025-02-23 14:44:29 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:40:45 +01:00
2025-02-23 14:44:29 +01:00
2025-02-23 14:40:45 +01:00

Terraform Proxmox Talos

This Terraform module provisions a Talos Linux cluster on a Proxmox Virtual Environment.
It is is based on a greate article by Olav S. Thoresen: Talos cluster on Proxmox with Terraform.
In addition to the configuration provided by the article, this module enables you to provision a HA control plane and any number of worker nodes.

Setup

Configure .env:

export PROXMOX_VE_USERNAME="root@pam"
export PROXMOX_VE_PASSWORD="super-secure-password"
export PROXMOX_VE_ENDPOINT="https://<proxmox-ip>:8006/"

Apply configuration:

terraform apply

Write Kubeconfig (caution, this will override you existing Kubeconfig):

terraform output -raw kubeconfig > ~/.kube/config

Requirements

Name Version
proxmox 0.72.0
talos 0.7.1

Providers

Name Version
proxmox 0.72.0
talos 0.7.1

Modules

No modules.

Resources

Name Type
proxmox_virtual_environment_download_file.talos_nocloud_image resource
proxmox_virtual_environment_vm.talos_cp resource
proxmox_virtual_environment_vm.talos_worker resource
talos_cluster_kubeconfig.kubeconfig resource
talos_machine_bootstrap.bootstrap resource
talos_machine_configuration_apply.cp_config_apply resource
talos_machine_configuration_apply.worker_config_apply resource
talos_machine_secrets.machine_secrets resource
talos_client_configuration.talosconfig data source
talos_cluster_health.health data source
talos_machine_configuration.machineconfig_cp data source
talos_machine_configuration.machineconfig_worker data source

Inputs

Name Description Type Default Required
cluster_name n/a string "homelab" no
default_gateway n/a string "192.168.1.1" no
proxmox_nodes Names of the Proxmox nodes, used to download and reference node images list(string)
[
"ms-01"
]
no
talos_controlplane_config Machine configuration of control-plane nodes
list(object({
id = number
ip = string
name = string
node = string
cpu_cores = number
memory = number
disk_size = number
}))
[
{
"cpu_cores": 2,
"disk_size": 20,
"id": 101,
"ip": "192.168.1.181",
"memory": 2048,
"name": "talos-cp-01",
"node": "ms-01"
},
{
"cpu_cores": 2,
"disk_size": 20,
"id": 102,
"ip": "192.168.1.182",
"memory": 2048,
"name": "talos-cp-02",
"node": "ms-01"
},
{
"cpu_cores": 2,
"disk_size": 20,
"id": 103,
"ip": "192.168.1.183",
"memory": 2048,
"name": "talos-cp-03",
"node": "ms-01"
}
]
no
talos_version n/a string "1.9.4" no
talos_worker_config Machine configuration of worker nodes
list(object({
id = number
ip = string
name = string
node = string
cpu_cores = number
memory = number
disk_size = number
}))
[
{
"cpu_cores": 4,
"disk_size": 100,
"id": 111,
"ip": "192.168.1.191",
"memory": 4096,
"name": "talos-worker-01",
"node": "ms-01"
},
{
"cpu_cores": 4,
"disk_size": 100,
"id": 112,
"ip": "192.168.1.192",
"memory": 4096,
"name": "talos-worker-02",
"node": "ms-01"
},
{
"cpu_cores": 4,
"disk_size": 100,
"id": 113,
"ip": "192.168.1.193",
"memory": 4096,
"name": "talos-worker-03",
"node": "ms-01"
},
{
"cpu_cores": 4,
"disk_size": 100,
"id": 114,
"ip": "192.168.1.194",
"memory": 4096,
"name": "talos-worker-04",
"node": "ms-01"
}
]
no

Outputs

Name Description
kubeconfig n/a
talosconfig n/a
Description
Terraform module for provisioning Talos Linux on Proxmox VE
Readme 77 KiB
Languages
HCL 100%