Chapter 12 of 26
Deploying Google Kubernetes Engine: Clusters, Node Pools, and Workloads
Stand up GKE clusters and run containerized applications while understanding Autopilot vs Standard, regional vs zonal, and private cluster options.
GKE Fundamentals and Cluster Modes (Standard vs Autopilot)
From VMs to Containers
GKE is Google Cloud's managed Kubernetes service. Google runs the control plane; you run containerized workloads, building on what you learned with Compute Engine.
Two GKE Modes
As of 2026, GKE offers two modes: Standard (you manage node pools) and Autopilot (Google manages nodes, you focus on Pods and workloads).
GKE Standard
In Standard, you pick machine types, node counts, and many cluster options. You pay for control plane (for some clusters) and nodes. Ideal when you need hardware and OS control.
GKE Autopilot
In Autopilot, you do not manage nodes. You specify Pod CPU/memory, and Google provisions capacity. Billing is Pod-based and security best practices are enforced.
Exam Angle
Know when to choose Autopilot vs Standard: Autopilot for simplicity and managed ops; Standard for custom hardware, OS, and advanced tuning.
Hands-on: Creating Autopilot and Standard Clusters
Autopilot via Console
In Console: Kubernetes Engine > Clusters > Create, select Autopilot, name it `autopilot-demo`, pick a region, keep defaults, and click Create.
Autopilot via gcloud
Use `create-auto` for Autopilot:
```bash
gcloud container clusters create-auto autopilot-demo \
--region=us-central1
```
Standard via gcloud
Use `create` for Standard:
```bash
gcloud container clusters create standard-demo \
--zone=us-central1-a \
--num-nodes=3 \
--machine-type=e2-standard-4
```
Command Pattern to Remember
`create-auto` = Autopilot, no node flags; `create` = Standard, you specify zone/region and node settings. This pattern is a common exam cue.
Regional vs Zonal Clusters and Availability
Zonal Clusters
Zonal clusters run control plane and nodes in one zone (for example `us-central1-a`). They are simpler and cheaper but vulnerable to zone outages.
Regional Clusters
Regional clusters spread control plane and nodes across multiple zones in a region (like `us-central1-a/b/c`), improving availability at higher cost.
When to Use Which
Production, high-availability workloads → regional. Dev/test and cost-sensitive workloads → zonal is often fine.
Exam Cues
`--zone` = zonal; `--region` = regional. Multi-zone resilience hints toward regional clusters or multi-zonal node pools.
Private Clusters and Networking Basics
Public vs Private
Public clusters expose the control plane via public IP and may give nodes external IPs. Private clusters keep nodes internal-only and can restrict API access.
Why Private?
Private clusters improve isolation: nodes lack public IPs, and the control plane can be reachable only from your VPC or allowed networks.
Key Flags
For Standard: use VPC-native networking plus `--enable-private-nodes` and optionally `--enable-private-endpoint` and master authorized networks.
Networking Tools
Private clusters often rely on Cloud NAT for outbound internet access and VPN/Interconnect or Private Service Connect for private control plane access.
Code Lab: Creating a Private Standard Cluster and a Node Pool
Use these commands as a reference for exam-style questions and real deployments. They combine cluster creation, private networking, and node pool configuration.
Node Pools, Autoscaling, and Upgrades
What Are Node Pools?
Node pools are groups of nodes with shared config (machine type, disk, labels). A cluster can have multiple pools for different workloads and cost profiles.
Cluster Autoscaler
Cluster autoscaler changes node counts in a pool based on unschedulable Pods. Enable it with min/max node settings on Standard node pools.
Horizontal Pod Autoscaler
HPA scales Pod replicas using metrics like CPU. It is configured in Kubernetes YAML, not in GKE node pool settings.
Upgrades and Channels
Use release channels (rapid/regular/stable) and enable node auto-upgrade and auto-repair for safer, more automated cluster maintenance.
Autopilot Difference
In Autopilot, you do not manage node pools or cluster autoscaler. Google handles node provisioning and upgrades automatically.
Deploying a Containerized App with kubectl on GKE
Get Cluster Credentials
Use `gcloud container clusters get-credentials` with the cluster name, region/zone, and project so `kubectl` can reach the GKE API server.
Deployment + Service YAML
A Deployment defines Pods and replica count; a Service with `type: LoadBalancer` exposes them via a Google Cloud external load balancer.
Apply and Inspect
Run `kubectl apply -f hello-deploy.yaml`, then `kubectl get pods` and `kubectl get service` to confirm Pods are running and an external IP is assigned.
Exam Focus
Know that `type: LoadBalancer` provisions a cloud load balancer, and that `get-credentials` is required before using `kubectl` against a new GKE cluster.
Thought Exercise: Choosing Cluster Mode and Type
Scenario A: Startup Web API
Minimal ops skills, simple web API. Think: Autopilot for managed ops, and likely a regional cluster for higher availability.
Scenario B: GPUs and Spot Nodes
GPU and spot workloads point toward Standard mode with multiple node pools (GPU, general-purpose, spot) plus labels and taints.
Scenario C: Banking Security
Strong isolation needs imply a private cluster: private nodes, private endpoint, VPN/Interconnect, and Cloud NAT for outbound access.
Quiz 1: Cluster Modes and Types
Check your understanding of Autopilot vs Standard and regional vs zonal clusters.
You are asked to deploy a production workload that must survive a single-zone outage and minimize operational overhead. Which combination is the best fit?
- GKE Standard, zonal cluster with three nodes
- GKE Autopilot, regional cluster
- GKE Standard, zonal cluster with node autoscaling
- GKE Autopilot, zonal cluster
Show Answer
Answer: B) GKE Autopilot, regional cluster
The requirement to survive a zone outage points to a **regional** cluster. Minimizing operational overhead favors **Autopilot**. So, a GKE Autopilot regional cluster is the best fit. Standard zonal clusters, even with autoscaling, do not protect against zone failure.
Quiz 2: Private Clusters and Node Pools
Test your knowledge of private clusters, node pools, and autoscaling.
Which `gcloud` configuration most directly ensures that GKE nodes do NOT receive public IP addresses?
- Using `--region` instead of `--zone` when creating the cluster
- Enabling VPC-native (alias IP) with `--enable-ip-alias`
- Creating a private cluster with `--enable-private-nodes`
- Enabling cluster autoscaler with `--enable-autoscaling` on the node pool
Show Answer
Answer: C) Creating a private cluster with `--enable-private-nodes`
`--enable-private-nodes` is the flag that ensures nodes only receive internal IP addresses in a private cluster. Regional vs zonal and autoscaling do not control node IP assignment, and `--enable-ip-alias` configures VPC-native networking but does not by itself prevent external IPs.
Key Term Flashcards: GKE Clusters and Workloads
Use these cards to reinforce the most exam-relevant terms from this module.
- GKE Standard
- GKE operation mode where Google manages the control plane but you manage node pools (machine type, size, autoscaling, upgrades). Best when you need fine-grained control over nodes, OS images, and hardware such as GPUs.
- GKE Autopilot
- GKE operation mode where Google manages both control plane and nodes. You specify Pod resource requests, and Google provisions capacity automatically. Billing is Pod-based and node management is abstracted away.
- Zonal GKE cluster
- A cluster whose nodes (and typically control plane) run in a single zone, such as `us-central1-a`. Simpler and cheaper but vulnerable to zone-level outages.
- Regional GKE cluster
- A cluster whose control plane and node pools span multiple zones within a region, such as `us-central1-a/b/c`, providing higher availability against single-zone failures.
- Private GKE cluster
- A cluster where nodes have only internal IP addresses and the control plane endpoint can be restricted to private IP, improving isolation. Typically uses VPC-native networking and Cloud NAT for outbound internet.
- Node pool
- A group of GKE nodes with shared configuration (machine type, disk, labels, taints). A cluster can have multiple node pools for different workload types and cost strategies.
- Cluster autoscaler
- A feature that automatically adjusts the number of nodes in a node pool based on unschedulable Pods, enabled on Standard clusters with min and max node settings.
- Horizontal Pod Autoscaler (HPA)
- A Kubernetes resource that automatically scales the number of Pod replicas based on metrics such as CPU utilization or custom metrics.
- `gcloud container clusters get-credentials`
- Command that retrieves GKE cluster credentials and updates local kubeconfig so `kubectl` can communicate with the cluster.
- Service type LoadBalancer
- A Kubernetes Service type that provisions a cloud load balancer (on GKE, a Google Cloud external or internal load balancer) to expose Pods via a stable IP.
Key Terms
- Node pool
- A group of GKE nodes in a cluster that share configuration like machine type, disk, labels, and taints.
- GKE Standard
- GKE operation mode where Google manages the control plane but you manage node pools (machine type, size, autoscaling, upgrades). Best when you need fine-grained control over nodes, OS images, and hardware such as GPUs.
- GKE Autopilot
- GKE operation mode where Google manages both control plane and nodes. You specify Pod resource requests, and Google provisions capacity automatically. Billing is Pod-based and node management is abstracted away.
- Zonal cluster
- A GKE cluster whose nodes (and typically control plane) run in a single zone, such as us-central1-a, with lower cost but less resilience to zone outages.
- Private cluster
- A GKE cluster where nodes have only internal IP addresses and the control plane endpoint can be restricted to private IP, often combined with Cloud NAT and VPN/Interconnect.
- Regional cluster
- A GKE cluster whose control plane and node pools span multiple zones within a region, such as us-central1-a/b/c, improving availability.
- Cluster autoscaler
- A feature that automatically adjusts the number of nodes in a node pool based on unschedulable Pods, configured with min and max node counts.
- VPC-native (alias IP)
- A networking mode where GKE Pods receive IP addresses from the VPC subnet via alias IP ranges, enabling better IP management and integration with Google Cloud networking features.
- Horizontal Pod Autoscaler
- A Kubernetes resource that automatically scales the number of Pod replicas based on metrics such as CPU utilization or custom metrics.
- Service type LoadBalancer
- A Kubernetes Service type that provisions a cloud load balancer to expose a set of Pods via a stable IP address.