This assumes that you already have a Google Cloud Platform account and have created and selected a project with the necessary services enabled
gcloud init
gcloud auth application-default login
- Create the Kubernetes cluster (this will take a few minutes)
gcloud container clusters create <cluster-name> --cluster-version=1.16 \
--num-nodes=30 \
--no-enable-autoupgrade
--enable-autoscaling
--min-nodes 15
--max-nodes 50
- After the cluster has completed, verify that there are 3 nodes running:
gcloud compute instances list
- Generate a kubeconfig entry that uses gcloud for authentication
gcloud container clusters get-credentials <cluster-name> --zone <zone> --project <project>
Clone the cluster-baseline
repository:
git clone git@github.com:CloudNativeGBB/cluster-baseline.git
cd cluster-baseline/infrastructure/gcp
- Verify that Terraform is >= 0.13.2
terraform version
-
Open
terraform.tfvars
and replace the default values with yourproject_id
,region
, andcluster_name
-
Initialize Terraform
terraform init
-
To see any changes in advance that are required for your infrastructure, use
terraform plan
. -
Create the cluster using Terraform templates
terraform apply
- Generate a kubeconfig entry that uses gcloud for authentication
gcloud container clusters get-credentials <cluster-name> --zone <zone> --project <project>