-
Notifications
You must be signed in to change notification settings - Fork 23
Deploy a GKE cluster
This Terraform plan deploys a Kubernetes cluster in Google Kubernetes Engine (GKE).
-
Define and configure the GCP project.
-
Log into Google Cloud Platform using its CLI interface.
$ gcloud auth login
-
Create a new project in Google Cloud Platform and make it your default project.
$ gcloud projects create cnseries-deployment Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/cnseries-deployment]. Waiting for [operations/cp.8399975532101480302] to finish...done. Enabling service [cloudapis.googleapis.com] on project [cnseries-deployment]... Operation "operations/acf.7db11421-7961-43d0-94c3-9063cadc40c9" finished successfully. $ gcloud config set project cnseries-deployment Updated property [core/project].
-
Map the newly defined project to your billing account.
$ gcloud beta billing accounts list ACCOUNT_ID NAME OPEN MASTER_ACCOUNT_ID 012356-A12345-B12345 My Billing Account True $ gcloud beta billing projects link cnseries-deployment --billing-account=012356-A12345-B12345 billingAccountName: billingAccounts/012356-A12345-B12345 billingEnabled: true name: projects/cnseries-deployment/billingInfo projectId: cnseries-deployment
-
Enable the Kubernetes Engine API for your project (this takes a few minutes to complete).
$ gcloud services enable container.googleapis.com Operation "operations/acf.c1e67633-3438-43a0-8929-61669cc6f6b3" finished successfully.
-
-
Deploy the cluster using Terraform
-
Create a
terraform.tfvars
file and add the following variables and their associated values.project = "" # The GCP project ID region = "" # The GCP region
-
Initialize the Terraform providers.
$ terraform init
-
Validate the Terraform plan.
$ terraform plan
-
Apply the Terraform plan.
$ terraform apply
-
-
Access the Kubernetes cluster
-
Update the kubeconfig file with the new cluster's information.
$ gcloud container clusters get-credentials $(terraform output cluster_name) --region $(terraform output cluster_location) --project $(terraform output cluster_project)
-
Verify the cluster nodes have been built and are in a Ready status.
$ kubectl get nodes NAME STATUS ROLES AGE VERSION gke-cnseries-testing-cnseries-testing-1e1ebbe6-6d3s Ready <none> 7m21s v1.14.10-gke.36 gke-cnseries-testing-cnseries-testing-c89de143-0710 Ready <none> 7m53s v1.14.10-gke.36 gke-cnseries-testing-cnseries-testing-d320cbc7-rtm2 Ready <none> 7m51s v1.14.10-gke.36
-
-
You are now ready to Deploy the CN‐Series Firewall.