Production GKE Platform — From Zero to Production›Part 1 · Cheat sheet & self-check

Part 1 — Foundations · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

01 · Google Cloud & GKE services and terms

Find your way around

gcloud config listActive account, project and default region/zone
gcloud config set project my-prod-projectSwitch the project every later command uses
gcloud projects listProjects you can see
gcloud services list --enabledAPIs enabled in the project (container.googleapis.com for GKE)
gcloud services enable container.googleapis.com artifactregistry.googleapis.comEnable the GKE and Artifact Registry APIs

GKE at a glance

gcloud container clusters listClusters in the project, with location, version and status
gcloud container get-server-config --region europe-west1Versions available per release channel in a region
gcloud container clusters get-credentials prod --region europe-west1Write a kubeconfig entry (uses gke-gcloud-auth-plugin)
gcloud container node-pools list --cluster prod --region europe-west1Node pools of a Standard cluster

02 · GKE architecture: Autopilot, Standard, regional and release channels

Create (lab)

gcloud container clusters create-auto lab --region europe-west1An Autopilot cluster: regional, release channel Regular by default
gcloud container clusters create lab --region europe-west1 --release-channel regular --num-nodes 1A Standard regional cluster: 1 node per zone (3 in total)
gcloud container clusters create lab-z --zone europe-west1-b --num-nodes 2A zonal Standard cluster (cheaper, no control-plane redundancy)

Inspect

gcloud container clusters describe lab --region europe-west1 --format='value(autopilot.enabled,releaseChannel.channel,currentMasterVersion)'Mode, channel and control-plane version
gcloud container get-server-config --region europe-west1 --flatten=channels --format='table(channels.channel,channels.defaultVersion)'Default version per release channel
kubectl get nodes -L topology.kubernetes.io/zoneNodes and the zones they run in