Provision a GKE Cluster in GCP
In the "Code Editor" tab, edit the following files:
variables.tf: Define input variablesproject_id(string, no default),region(string, default:us-central1),cluster_name(string, default:my-gke-cluster),node_count(number, default:1), andmachine_type(string, default:e2-medium), each with appropriate descriptions.outputs.tf: Define outputscluster_name(GKE cluster name) andcluster_endpoint(cluster endpoint).gke.tf: Configure a GKE cluster using the defined variables, inus-central1, with a default node pool (to be removed) and a separate node pool withvar.node_countnodes andvar.machine_type.terraform.tfvars: Setproject_id = "my-gcp-project".
The provider.tf file is pre-configured and read-only.
GitOps Repository
- 📁 /root/learn-terraform-gcp-gke
- 📄 provider.tf
- 📄 gke.tf
- 📄 variables.tf
- 📄 outputs.tf
- 📄 terraform.tfvars