Bitzu

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

Single choice

Which command writes a kubeconfig entry so kubectl can talk to a GKE cluster?

  1. gcloud container clusters get-credentials
  2. gcloud container clusters login
  3. kubectl config import-gke
  4. 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.

Select all that apply

Which steps are needed before kubectl can manage a GKE cluster from your workstation?

  1. Install kubectl
  2. Install gke-gcloud-auth-plugin
  3. Run gcloud container clusters get-credentials
  4. Install Docker Desktop
  5. 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

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.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module