1.3 KiB
1.3 KiB
Agent Guide
Project Summary
Incus cluster managed with OpenTofu. The cluster has 2 hypervisors and 1 witness for quorum.
CLI
Always use tofu, never terraform.
Architecture
Two-role cluster: hypervisors run workloads, witnesses maintain database quorum.
Every cluster-wide resource (network, storage pool) follows a three-layer pattern:
- Per-hypervisor target resources
- Per-witness target resources
- Cluster-wide resource that
depends_onboth
Module Conventions
Modules live in modules/<resource>/. Each module accepts:
name— resource name- A resource-specific type/driver string
hypervisors/witnesses— sets of node nameshypervisor_config/witness_config— free-formmap(string)for per-role provider config
The root module iterates with for_each over a variable map and fans values into the module.
File Layout
One root .tf file per concern:
provider.tf— provider configurationgroups.tf— cluster groupsnetwork.tf— network resourcesstorage.tf— storage pool resourcesvariables.tf— variable declarations
Variable values live in .auto.tfvars files, one per concern.
Validation
After any change:
tofu validatetofu plan
Plan output should show no unexpected replacements or destroys for existing resources.