terraform-provider-flux icon indicating copy to clipboard operation
terraform-provider-flux copied to clipboard

Where to use this?

Open MarkLFT opened this issue 2 years ago • 1 comments

Sorry for this really dumb question, I am very new to Terraform and Flux, and trying to work it all out.

I have created a Terraform file that uses the ESXI provider to create a VM. Within that I use cloud-init to configure the VM and install k8s. I would now like to install and configure flux onto this VM. My question is, can I use this flux provider within the same tf file that created the VM, or do I install and run Terraform inside the VM?

MarkLFT avatar Apr 04 '22 07:04 MarkLFT

Hi, it depends on your workflow. This terraform provider is combined with the kubernetes provider to install flux. The kubernetes provider only requires kubeconfig of the target cluster to install flux if you only want to bootstrap flux using flux_install data source. If you also want to write the flux manifests in git, there are some extra requirements related to your git provider and repository access as shown in the bootstrap example https://registry.terraform.io/providers/fluxcd/flux/latest/docs/guides/github . You can use this within the same terraform configuration that creates the VM if you can fetch and provide the kubeconfig of the created cluster to the kubernetes provider to be used with flux_install data source. Or you can have it independent, passing the kubeconfig separately, whatever works for your setup.

darkowlzz avatar Apr 04 '22 10:04 darkowlzz