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
- Run
terraform initto initialize the working directory and download Terraform providers and modules - 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 - 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 typeyeswhen prompted - 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: