proxmox

Automate Homelab Deployment With Terraform & Proxmox

Automate Homelab Deployment With Terraform & Proxmox

#Automate #Homelab #Deployment #Terraform #Proxmox

“Jim’s Garage”

Terraform is a powerform ‘infrastructure as code’ tool to automate deployments. In this video I use it to create VMs in Proxmox ready for a Kubernetes or Docker Swarm cluster.

Examples…

source

 

To see the full content, share this page by clicking one of the buttons below

Related Articles

20 Comments

  1. Awesome video! I am actually working on the exact same project and I’m using your script as input to provision the cluster with a few tweaks

    The only thing I added into the process is packer. I preinstall packages for my K3s-ansible controller and I export the public SSH key onto a share during building the cloud init image. I also use the ansible server as my terraform and packer builder server. Just a bit of a chicken and egg problem.

    For my K3s nodes I inject this public ssh key and create the ansible user in the packer image.

    Once all done my ansible machine can immediately connect to all K3s nodes and start building the cluster.

    Still a work in progress but it’s super nice you are doing exactly what I’m working on and your videos are extremely useful

  2. Can we talk about the elephant in the room here, that is Hashicorp and the new terraform licence? OpenTofu is definatrly the way forward in theory you should just be able to drop in OpenTofu and carry on the same with terraform.

  3. The provider by bpg works like a charm as has been up-to-date ever since, compared to Telmate's. It also has resources & data sources for everything, starting from basic settings like the keyboard layout of Proxmox itself to firewall rules. Of course VMs & CTs are supported as well 😄 Telmate supports… 2.
    I can only recommend it, but sadly many users are being fouled by GitHub stars and other useless metrics.

  4. I hope that Talmate project gets legs under it and grows. It would be nice in a Proxmox cluster to be able to assign these VMs to various nodes in the deploy. eg three Proxmox nodes, this would then build a master and x workers per Proxmox node.

    I wonder if there is a provider for iDRAC7, could get real close to metal then. get three new dell servers, use Terraform to update them, provision disks, install Proxmox, setup the cluster, and CEPH; this run this to provision the VMs

  5. You should try the bpg/proxmox provider instead of the telmate one, as it supports many more features. I also recently investigated Terraform on proxmox and I'm glad I found bpg's provider. It provides a wide range of resources and data sources for managing VMs, firewalls, files (VM images, snippets), etc., so you can configure your entire proxmox infrastructure in Terraform. One particularly useful feature is the ability to upload custom cloud-init snippets that I used to deploy scripts that set up my k3s cluster. Also, I found that bpg works more stable for me when I tried the telmate's provider I encountered a few times race conditions on the disk setup step that failed the terrafom apply command.

  6. Thanks James. I tried telmate but it did not worked. I using now bpg provider and test the same. It will provision the required number of machines and create the host file for anisble then ansible will provision the k3s cluster with metallb. testing now longhorn and other apps provisioning. Thanks again for such informative videos

Leave a Reply