mirror of
https://github.com/0x1d/terraform-proxmox-talos.git
synced 2025-12-14 14:01:28 +01:00
7.0 KiB
7.0 KiB
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.
Configuration
Configure .env:
export PROXMOX_VE_USERNAME="root@pam"
export PROXMOX_VE_PASSWORD="super-secure-password"
export PROXMOX_VE_ENDPOINT="https://<proxmox-ip>:8006/"
Configure module (no-ha example):
module "talos_cluster" {
source = "../../"
cluster_name = "homelab"
talos_version = "1.9.4"
default_gateway = "192.168.1.1"
proxmox_nodes = ["ms-01"]
talos_controlplane_config = [{
id = 101
name = "talos-cp-01"
ip = "192.168.1.181"
node = "ms-01"
cpu_cores = 2
memory = 2048
disk_size = 20
}]
talos_worker_config = [{
id = 111
name = "talos-worker-01"
ip = "192.168.1.191"
node = "ms-01"
cpu_cores = 4
memory = 4096
disk_size = 100
}]
}
output "kubeconfig" {
value = module.talos_cluster.kubeconfig
sensitive = true
}
Provisioning
Apply configuration:
source .env
terraform init
terraform apply
Write Kubeconfig (caution, this will override you existing Kubeconfig):
terraform output -raw kubeconfig > ~/.kube/config
Verify:
kubectl get nodes
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) |
[ |
no |
| talos_controlplane_config | Machine configuration of control-plane nodes | list(object({ |
[ |
no |
| talos_version | n/a | string |
"1.9.4" |
no |
| talos_worker_config | Machine configuration of worker nodes | list(object({ |
[ |
no |
Outputs
| Name | Description |
|---|---|
| kubeconfig | n/a |
| talosconfig | n/a |