Skip to content

Instantly share code, notes, and snippets.

@lmakarov
Created July 22, 2021 19:05
Show Gist options
  • Save lmakarov/e075b6ef0e6c4c686be62295f16398a7 to your computer and use it in GitHub Desktop.
Save lmakarov/e075b6ef0e6c4c686be62295f16398a7 to your computer and use it in GitHub Desktop.
Create a GKE Standard cluster matching GKE Autopilot configuration (aka Fullpilot)
# Configuring gcloud
export PROJECT_ID=my-project-12345
export COMPUTE_REGION=us-central1
gcloud components update
gcloud config set project ${PROJECT_ID}
gcloud config set compute/region ${COMPUTE_REGION}
# Setting up a GKE cluster
export CLUSTER_NAME=my-cluster-1
export CHANNEL=stable
# # Create GKE Autopilot cluster
# gcloud container clusters create-auto ${CLUSTER_NAME} \
# --release-channel=${CHANNEL} \
# --region=${COMPUTE_REGION} \
# --project=${PROJECT_ID}
# Create a GKE Standard cluster matching GKE Autopilot configuration (aka Fullpilot)
gcloud beta container clusters create ${CLUSTER_NAME} \
--region "us-central1" \
--node-locations "${COMPUTE_REGION}-f" \
--release-channel "regular" \
--machine-type="e2-medium" \
--disk-type "pd-ssd" \
--disk-size "32" \
--preemptible \
--num-nodes "1" \
--enable-autoscaling \
--autoscaling-profile "optimize-utilization" \
--min-nodes "1" \
--max-nodes "2" \
--enable-ip-alias \
--default-max-pods-per-node "110" \
--enable-stackdriver-kubernetes \
--no-enable-master-authorized-networks \
--enable-autoupgrade \
--max-surge-upgrade "1" \
--max-unavailable-upgrade "0" \
--workload-pool "${PROJECT_ID}.svc.id.goog" \
--addons "HorizontalPodAutoscaling,HttpLoadBalancing,NodeLocalDNS,GcePersistentDiskCsiDriver" \
--enable-vertical-pod-autoscaling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment