Topic 4 of 11
The exam guide asks you to install and configure kubectl, deploy GKE clusters with different configurations (Autopilot, regional, and private), and deploy a containerized application. Day-to-day cluster operation (node pools, Pod autoscaling, Artifact Registry) is covered in domain D3.
Contents
Control plane
Always managed by GKE. Runs the Kubernetes API server (kube-apiserver), the scheduler, controllers, and the cluster state store. It runs on VMs in a Google-managed project.
Nodes
Compute Engine VMs where Pods run. GKE manages them in Autopilot and you manage them in Standard.
Everything goes through the API server: kubectl, the console, and the cluster's own components are its clients. You tell Kubernetes the desired state of objects and Kubernetes works to maintain it.
Cloud Shell already includes gcloud and kubectl. On your machine, kubectl is installed as a gcloud component or with apt/yum, and it needs the gke-gcloud-auth-plugin authentication plugin: without it, kubectl can't talk to GKE.
gcloud components install kubectl gcloud components install gke-gcloud-auth-plugin kubectl version --client # Store the cluster credentials in kubeconfig gcloud container clusters get-credentials CLUSTER_NAME --location=us-central1 kubectl get namespaces
$HOME/.kube/config by default.get-credentials adds the entry and switches the current context. Creating the cluster with gcloud does too.--location is a region for regional clusters or a zone for zonal ones. Set a default compute/region or compute/zone so you don't have to pass it every time.kubectl config view. Switch clusters: kubectl config use-context.Autopilot is the mode where Google manages nodes, scaling, security, and other settings, and provisions resources based on your manifests. Google recommends it for most production workloads. In a Standard cluster you can also run specific workloads in Autopilot mode with ComputeClasses.
| Autopilot | Standard | |
|---|---|---|
| Location | Always regional | Regional or zonal |
| Nodes | Managed by GKE, which adjusts their number and size to the Pods | You create and manage node pools (optional: cluster autoscaler, node auto-provisioning) |
| Node OS | Container-Optimized OS with containerd | Container-Optimized OS by default; also Ubuntu or Windows Server |
| Billing | For the resources Pods request | For all node resources |
| Pre-configured security | Workload Identity Federation for GKE, Shielded GKE Nodes, secure boot | Shielded GKE Nodes by default; the rest optional |
| Pods per node | Maximum 256 | 110 by default, maximum 512 |
| Upgrades | Node auto-repair and auto-upgrade pre-configured; always in a channel | Automatic with a channel; configurable upgrade strategies |
| Cloud Marketplace | No | Yes |
| SLA | Covers the control plane and Pod compute capacity | No Pod-level SLA |
# Autopilot (always regional) gcloud container clusters create-auto hello-cluster --location=us-central1 # Regional Standard gcloud container clusters create std-cluster --location=us-central1 --num-nodes=1
| Type | Control plane | Default nodes |
|---|---|---|
| Regional | Replicas across zones in the region: stays available if a zone fails and during upgrades | Multi-zonal (three zones) |
| Zonal | One, in a single zone. Workloads keep running if it fails, but you can't configure the cluster until it is back | A single zone (can become multi-zonal) |
--node-locations to specify zones that have that GPU.What the exam guide calls "private clusters" the current docs treat as network isolation, which controls three kinds of access: to the control plane from outside, from the API server to external webhooks, and to the nodes from outside.
Control plane access
Private nodes
With or without private nodes, the control plane talks to nodes over internal IPs only. If you expand a subnet used by a cluster with authorized networks, update the authorized networks list too.
GKE upgrades every cluster automatically. The channel sets the balance between new features and stability; maintenance windows and exclusions control when it happens.
| Channel | What for |
|---|---|
| Rapid | The newest versions, 1-2 weeks after Kubernetes GA. For pre-production; excluded from the GKE SLA |
| Regular (default) | Balance between features and stability. Recommended for most users |
| Stable | Prioritizes stability; gets changes last |
| Extended | Long-term support: keep a minor version for as long as possible |
"No channel" is going away
Not enrolling a cluster in a channel (formerly "Static") is deprecated, allowed only for existing customers, and will be removed on June 14, 2027; after that, GKE enrolls those clusters in Stable. Autopilot clusters can only be enrolled in a channel.
The official quickstart flow: enable the GKE and Artifact Registry APIs, have the roles/container.admin role, create the cluster, and deploy.
Create the cluster: gcloud container clusters create-auto hello-cluster --location=us-central1
Create a Deployment: kubectl create deployment hello-server --image=IMAGE (for example, from Artifact Registry)
Expose it: kubectl expose deployment hello-server --type LoadBalancer --port 80 --target-port 8080, which creates a Compute Engine load balancer
Check: kubectl get pods and kubectl get service hello-server to see the EXTERNAL-IP
kubectl apply -f instead of imperative commands.LoadBalancer Service gets an ephemeral external IP; to use a static IP you already reserved, set it in loadBalancerIP. Autopilot doesn't support externalIps.| Situation | Answer | Why |
|---|---|---|
| The team doesn't want to manage nodes and wants to pay only for what Pods request | GKE Autopilot | Google manages nodes; you pay for requested resources. |
| You need Windows Server nodes or Cloud Marketplace apps | GKE Standard | Autopilot supports neither. |
| The control plane must stay available if a zone fails | Regional cluster | Replicates the control plane across zones. |
| Nodes must have no public IPs but still download packages from the internet | Private nodes + Cloud NAT | Without NAT there is no internet egress. |
| kubectl must point to the cluster a colleague just created | gcloud container clusters get-credentials | Adds the kubeconfig entry and switches context. |
| Keep a Kubernetes minor version for as long as possible | Extended channel | Long-term support. |
| Expose a Deployment to the internet with an external IP | kubectl expose --type LoadBalancer | Creates a Compute Engine load balancer. |
❓ Can you create a zonal Autopilot cluster?
No. Autopilot clusters are always regional.
❓ Can a regional cluster be changed to zonal?
No, it can't be changed after creation.
❓ What do you need besides kubectl to connect to GKE?
The gke-gcloud-auth-plugin, which provides the authentication tokens.
❓ Can private nodes download images from the internet on their own?
No. They need Cloud NAT or another NAT solution to reach the internet.
❓ How many nodes does a regional Standard cluster create by default?
Nine: three per zone in three zones. It can fail on the in-use IP address quota.
❓ What is the default release channel?
Regular.
Did you get this topic?
Test what you just learned
A company needs a GKE cluster whose nodes have no public IPs and aren't reachable from the internet, but whose workloads must call an external API. The platform team wants to administer the control plane from its office network without bastions. What should it configure?