Sample Google Cloud Command for Cluster Creation

This sample command can be used to help create a cluster on Google Cloud

export PROJECT=sample-project
export CLUSTER=sample-cluster-001
export VPC=sample-vpc
export SUBNETWORK=sample-vpc-1
export CLUSTER_RANGE=sample-vpc-1-pod-addr-range
export SERVICE_RANGE=sample-vpc-1-service-addr-range
export GKE_VERSION=1.17.13-gke.2600
export SERVICE_ACCOUNT=custom-sa@sample-project.iam.gserviceaccount.com

gcloud beta container --project "$PROJECT" clusters create "$CLUSTER" \
--enable-stackdriver-kubernetes \
--addons=GcePersistentDiskCsiDriver \
--enable-private-nodes \
--enable-ip-alias \
--maintenance-window "05:00" \
--enable-shielded-nodes \
--no-enable-basic-auth \
--no-issue-client-certificate \
--no-enable-autoupgrade \
--network "projects/$PROJECT/global/networks/$VPC" \
--subnetwork "projects/$PROJECT/regions/us-west1/subnetworks/$SUBNETWORK" \
--cluster-secondary-range-name "$CLUSTER_RANGE" \
--services-secondary-range-name "$SERVICE_RANGE" \
--no-enable-master-authorized-networks \
--master-ipv4-cidr 10.4.5.0/28 \
--region "us-west1" \
--cluster-version "$GKE_VERSION" --release-channel "None" \
--machine-type "n1-highmem-16" --image-type "UBUNTU" \
--local-ssd-count "8" \
--disk-type "pd-standard" --disk-size "50" \
--node-labels cassandra-1=true,mjcachedpl-1-1=true,servicedpl-1-1=true,djcachedpl-17-1-1=true,flushdpl-1=true,jddpl-1=true,jddpl-2=true \
--metadata disable-legacy-endpoints=true \
--service-account "$SERVICE_ACCOUNT" \
--num-nodes "1" \
--max-surge-upgrade 1 --max-unavailable-upgrade 0 --max-pods-per-node "64" \
--tags "vbos-dpl-pool" --node-locations "us-west1-a","us-west1-b","us-west1-c"

gcloud beta container --project "$PROJECT" node-pools create "vbos-bd-pool" \
--cluster "$CLUSTER" --region "us-west1" --node-version "$GKE_VERSION" \
--machine-type "e2-highmem-8" --image-type "UBUNTU" --disk-type "pd-standard" --disk-size "100" \
--node-labels bd=true \
--metadata disable-legacy-endpoints=true \
--service-account "$SERVICE_ACCOUNT" \
--num-nodes "1" \
--max-surge-upgrade 1 --max-unavailable-upgrade 0 --max-pods-per-node "64" \
--tags "vbos-bd-pool" --node-locations "us-west1-a","us-west1-b","us-west1-c"

gcloud beta container --project "$PROJECT" node-pools create "vbos-cmap-pool" \
--cluster "$CLUSTER" --region "us-west1" --node-version "$GKE_VERSION" \
--machine-type "n2-highmem-8" --image-type "UBUNTU" --disk-type "pd-standard" --disk-size "50" \
--local-ssd-count "4" \
--node-labels cmapdcdpl-17-1=true,cmapmcdpl-1=true \
--metadata disable-legacy-endpoints=true \
--service-account "$SERVICE_ACCOUNT" \
--num-nodes "1" \
--enable-autoscaling --min-nodes "1" --max-nodes "2" \
--max-surge-upgrade 1 --max-unavailable-upgrade 0 --max-pods-per-node "64" \
--tags "vbos-cmap-pool" --node-locations "us-west1-a","us-west1-b"