Proxmox and Talos Node Provisioning

Relevant source files

This page details the automated provisioning of the home-ops infrastructure layer, focusing on the lifecycle of Talos Linux nodes running on a Proxmox hypervisor. The process integrates Terraform for hardware virtualization, Jinja2/OpenTofu templating for immutable OS configuration, and the TUPPR controller for rolling cluster upgrades.

Infrastructure Lifecycle Overview

The provisioning workflow follows a “Virtualization-as-Code” pattern where the Proxmox hypervisor is treated as a target for the bpg/proxmox Terraform provider.

Provisioning Data Flow

The following diagram illustrates the relationship between configuration files and the resulting infrastructure entities.

Diagram: Configuration to Provisioning Mapping

[Flowchart Diagram]

Sources: infrastructure/terraform/proxmox/talos/virtual-machines.tf1-149infrastructure/terraform/proxmox/talos/machine-config/common.yaml.tftpl1-159infrastructure/terraform/proxmox/talos_cluster.auto.tfvars1-31

Proxmox VM Provisioning

VMs are managed using the bpg/proxmox provider infrastructure/terraform/proxmox/providers.tf23-26 The configuration utilizes a q35 machine type and virtio-scsi-single hardware for optimal performance infrastructure/terraform/proxmox/talos/virtual-machines.tf12-14

Hardware and iGPU Passthrough

For workloads requiring hardware acceleration (e.g., Plex/Jellyfin), Intel iGPU passthrough is configured at the VM level.

Storage and Network

Sources: infrastructure/terraform/proxmox/talos/virtual-machines.tf1-150infrastructure/terraform/proxmox/talos/machine-config/common.yaml.tftpl1-87

Talos Machine Configuration

Talos Linux is configured through immutable YAML files generated from Terraform templates (.tftpl). These templates allow for dynamic injection of variables such as IP addresses, disk paths, and Kubernetes versions.

Configuration Components

ComponentFile PathDescription
Commoncommon.yaml.tftplShared sysctls, kernel modules, and kubelet feature gates infrastructure/terraform/proxmox/talos/machine-config/common.yaml.tftpl1-159
Control Planecontrol-plane.yaml.tftplVIP configuration, etcd settings, and API server manifests infrastructure/terraform/proxmox/talos/machine-config/control-plane.yaml.tftpl1-40
Workerworker.yaml.tftplWorker-specific node labels and hardware passthrough settings

Key System Optimizations

The common.yaml.tftpl includes several high-performance sysctl tunings for 10Gb/s networking and PostgreSQL workloads:

Sources: infrastructure/terraform/proxmox/talos/machine-config/common.yaml.tftpl1-83infrastructure/terraform/proxmox/talos/machine-config/control-plane.yaml.tftpl1-40

Talos Image Factory and Bootstrap

The cluster uses custom Talos images generated via the Talos Image Factory. The specific image schematic (drivers, extensions) is defined in schematic.yaml.

Bootstrap Process

The scripts/bootstrap-cluster.sh script handles the initial transition from bare VMs to a functional cluster:

  1. Apply Config: Renders machine configurations and applies them via talosctl apply-config --insecurescripts/bootstrap-cluster.sh10-62
  2. Bootstrap: Initiates the etcd cluster on a designated controller node scripts/bootstrap-cluster.sh65-80
  3. Kubeconfig: Fetches the admin credentials once the API server is up scripts/bootstrap-cluster.sh83-95
  4. Resource Handover: Applies CRDs and initial Helm releases via helmfile before Flux takes over scripts/bootstrap-cluster.sh115-172

Sources: scripts/bootstrap-cluster.sh1-198infrastructure/terraform/proxmox/talos/virtual-machines.tf86-91

Rolling Upgrades with TUPPR

Cluster maintenance is automated using TUPPR (Talos/Kubernetes Upgrade PR), which manages rolling upgrades for both the Talos OS and the Kubernetes components.

Upgrade Orchestration

TUPPR utilizes custom resources to define upgrade targets and health check policies.

Diagram: TUPPR Upgrade Logic

[Flowchart Diagram]

Configuration Entities

Sources: kubernetes/apps/system-upgrade/tuppr/upgrades/talosupgrade.yaml1-21kubernetes/apps/system-upgrade/versions.env1-5kubernetes/apps/system-upgrade/tuppr/app/ocirepository.yaml1-14