In this section, we will create GKE Clusters in our Google Cloud Shell using the gcloud CLI.
The gcloud command-line interface is the primary CLI tool to create and manage Google Cloud resources. You can use this tool to perform many common platform tasks either from the command line or in scripts and other automations.
export PROJECT_ID=`gcloud config get-value project`
echo $PROJECT_ID
export REGION=<your region>
echo $REGION
export ZONE=<your zone>
echo $ZONE
gcloud container clusters create testgcpworkshop --zone $ZONE --release-channel=rapid --machine-type=e2-standard-2 --image-type=COS --disk-type=pd-ssd --disk-size=10 --num-nodes=1 --enable-autoupgrade --enable-autorepair --async
gcloud container clusters create staginggcpworkshop --zone $ZONE --release-channel=rapid --machine-type=e2-standard-2 --image-type=COS --disk-type=pd-ssd --disk-size=10 --num-nodes=1 --enable-autoupgrade --enable-autorepair --async
gcloud container clusters create gcpworkshop --zone $ZONE --release-channel=rapid --machine-type=e2-standard-2 --image-type=COS --disk-type=pd-ssd --disk-size=10 --num-nodes=1 --enable-autoupgrade --enable-autorepair --async
With this command we have specified the following GKE cluster properties:
It will take a few minutes to create the GKE clusters. While we wait, we can move on to set up the rest of the workshop.