Import GKE Cluster using Terraform

Prerequisite

This script assumes that you have already created the necessary IAM resources to create GKE related resources through Kosmos.

For more details refer:

How to run

  1. Run terraform init to initialize the working directory and download Terraform providers and modules
  2. Run terraform plan -var="kosmos_access_key=(kosmos_access_key)" to preview the changes to be made by Terraform and read thoroughly on resources to be created
  3. Run terraform apply -var="kosmos_access_key=(kosmos_access_key))" -var="gcp_project_id=(gcp_project_id)" -var="fleet_name=(fleet_name)" -var="cluster_name=(cluster_name)" -var="kosmos_user=(kosmos_user)" and type yes when prompted
  4. To destroy all the resources, run terraform destroy -var="kosmos_access_key=(kosmos_access_key))" -var="gcp_project_id=(gcp_project_id)" -var="fleet_name=(fleet_name)" -var="cluster_name=(cluster_name)" -var="kosmos_user=(kosmos_user)"

Download Resources

For complete examples and the latest updates, refer to:

Edit this page on GitHub