Deploy GKE cluster using Terraform

From wikieduonline
Revision as of 17:17, 7 December 2023 by Welcome (talk | contribs) (→‎Terraform apply)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Execution[edit]

git clone https://github.com/hashicorp/learn-terraform-provision-gke-cluster
cd learn-terraform-provision-gke-cluster
terraform init

Change project_id in terraform.tfvar file with name of your cluster. (See: gcloud projects create)

Terraform plan (GKE)[edit]

Terraform apply[edit]

terraform apply
.../... 
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

Outputs: 

kubernetes_cluster_host = "22.27.74.22"
kubernetes_cluster_name = "your-project-gke"
project_id = "your-project"
region = "us-central1"

Configure credentials to connect:

gcloud container clusters get-credentials $(terraform output -raw kubernetes_cluster_name) --region $(terraform output -raw region)
kubectl get pod -A


Error: error creating NodePool .../... Error 403: Insufficient regional quota to satisfy

Related[edit]

See als[edit]

Advertising: