Skip to content

Latest commit

 

History

History

gke-autopilot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

GKE - Google Kubernetes Engine

Description

This project demonstrates how to create a GKE Autopilot cluster. Resources created:

  • VPC
  • Subnet
  • NAT
  • GKE

Deploy

  1. Create a new project and select it.

  2. Open Cloud Shell and ensure the var below is set, otherwise set it with gcloud config set project command

echo $GOOGLE_CLOUD_PROJECT
  1. Create a bucket to store your project's Terraform state
gsutil mb gs://$GOOGLE_CLOUD_PROJECT-tf-state
  1. Enable the necessary APIs
gcloud services enable cloudbuild.googleapis.com \
compute.googleapis.com \
container.googleapis.com \
cloudresourcemanager.googleapis.com \
containersecurity.googleapis.com
  1. Go to IAM and add Editor.

  2. Clone this repo into the Cloud Shell VM

git clone https://github.com/sylvioneto/terraform_gcp.git
cd ./terraform_gcp/gke-autopilot
  1. Find and replace your-domain.com by your own domain.

  2. Execute Terraform using Cloud Build

gcloud builds submit . --config cloudbuild.yaml
  1. At this point your cluster and workloads ar up and running, please check it on GKE.

  2. (Optional) In other to issue the managed certificate, add the Ingresses IPs to your DNS records, so that GKE will provision the certificate. (reference).

Destroy

  1. Execute Terraform using Cloud Build
cd ./terraform_gcp/gke
gcloud builds submit . --config cloudbuild_destroy.yaml