Skip to content

ahgraber/homelab-infra

Repository files navigation

Bootstrap k3s cluster hosts with vSphere and Terraform

See: https://github.com/Terraform-VMWare-Modules/terraform-vsphere-vm

Use Terraform to provision VMs in vsphere and call ansible to configure hosts. The second half of this project (deploying a k3s cluster via gitops) is here

Bootstrap

Once customization is complete:

terraform init
terraform plan
terraform apply  # -auto-approve

In OPNsense, set Unbound DNS overrides to IP address and node name of terraform'd nodes

Update

Note: Terraform expects it will be used to manage all infrastructure changes. To update currently 'managed' deployment, update main.tf.

# 'plan' will warn if the change will require destroying/reprovisioning a replacement host
terraform plan
terraform apply  # -auto-approve

Destroy

To tear down terraform-managed infra, run:

terraform destroy  # -auto-approve

References