Terraform provider with Tanzu Mission Control gives operations teams the ability to be infrastructure agnostic and build a code pipeline that accommodates a variety of infrastructure back ends. With Terraform, you can attach any conformant Kubernetes cluster to Tanzu Mission Control, therefore providing increased DevOps velocity by offering an additional route to consistent deployments and management of Kubernetes. In this post, I will explain the steps to create workload cluster using Terraform on vSphere with Tanzu.
- For this demo, I have registered management cluster (vSphere with Tanzu) to TMC.
- Install steps are given here, you can follow the same based on bootstrap machine:
- Check Terraform Version:
- Create a directory with name as terraform-demo:
- Create files with below content in directory terraform-demo and provide endpoint, vmw_cloud_api_token as shown in screenshot:
- Initialize the providers
- Export the variable
Create cluster group
- List the resources state
- Navigate to TMC Console > Clusters > capv-cluster-tf to check the status of cluster creation, which generally takes 5-10 mins to complete.
- Navigate to TMC Console > Cluster groups > capv-cluster-cg should be in the list.
- Once completely deployed, execute below commands to delete the resources.