Associate Cloud Engineer ยท Containers and serverless deployments
GKE cluster modes and kubectl setup
Installing kubectl and the GKE auth plugin, get-credentials, Autopilot vs Standard, zonal vs regional, private clusters, release channels, and when GKE Enterprise features apply.
Key points
- Autopilot: Google manages the nodes and bills per Pod; Standard: you manage node pools.
- Clusters can be zonal (one zone) or regional (control plane across zones), public or private, and enrolled in a release channel.
- To use kubectl: install kubectl and gke-gcloud-auth-plugin, then run gcloud container clusters get-credentials NAME --location=LOCATION.
Source: https://docs.cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl
Practice questions
Which command writes a kubeconfig entry so kubectl can talk to a GKE cluster?
- gcloud container clusters get-credentials
- gcloud container clusters login
- kubectl config import-gke
- gcloud container kubeconfig create
Show answer
Answer: A. gcloud container clusters get-credentials
get-credentials generates the kubeconfig entry and sets the current context. The others do not exist for this purpose.
Which steps are needed before kubectl can manage a GKE cluster from your workstation?
- Install kubectl
- Install gke-gcloud-auth-plugin
- Run gcloud container clusters get-credentials
- Install Docker Desktop
- Add an SSH key to every node
Show answer
Answer: A. Install kubectl, B. Install gke-gcloud-auth-plugin, C. Run gcloud container clusters get-credentials
You need kubectl, the gke-gcloud-auth-plugin, and a kubeconfig entry from get-credentials. Docker and a node SSH key are not required.
True or false: in an Autopilot cluster you create and size node pools yourself.
Show answer
Answer: False
False. Autopilot manages the nodes for you; node pool management is a Standard-mode task.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
