Provisioning a GKE Autopilot cluster using Terraform
- Lets provision an gke autopilot cluster using terraform
- Refer Here for the changes done to provision the auto pilot cluster
- Now we need to configure the kubectl credentials for which we need to run the following cli command
gcloud container clusters get-credentials autopilot-cluster-default --region us-central1 --project peak-responder-438809-q5 - Terraform supports provisioners Refer Here for
- local-exec: running commands locally on the machine where terraform is executing
- remote-exec: running commands remotely on the machine by passing the ip and credentials
- file: copying files remotely
- Provisioners will be executed only when the resource is created Refer Here for changes done to get the kubectl configured and deployment into k8s
