Brains4Cloud
ESEN
Practice

Topic 4 of 11

D2 · Planning and implementing a cloud solution

GKE clusters

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.

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.

Installing and configuring kubectl

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
  • Credentials are stored in kubeconfig, at $HOME/.kube/config by default.
  • kubeconfig holds contexts (cluster + user + optional namespace). kubectl uses the current context.
  • 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.
  • View the configuration: kubectl config view. Switch clusters: kubectl config use-context.

Autopilot versus Standard

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.

AutopilotStandard
LocationAlways regionalRegional or zonal
NodesManaged by GKE, which adjusts their number and size to the PodsYou create and manage node pools (optional: cluster autoscaler, node auto-provisioning)
Node OSContainer-Optimized OS with containerdContainer-Optimized OS by default; also Ubuntu or Windows Server
BillingFor the resources Pods requestFor all node resources
Pre-configured securityWorkload Identity Federation for GKE, Shielded GKE Nodes, secure bootShielded GKE Nodes by default; the rest optional
Pods per nodeMaximum 256110 by default, maximum 512
UpgradesNode auto-repair and auto-upgrade pre-configured; always in a channelAutomatic with a channel; configurable upgrade strategies
Cloud MarketplaceNoYes
SLACovers the control plane and Pod compute capacityNo Pod-level SLA
  • If you deploy to Autopilot without CPU and memory requests, GKE applies default values and adjusts the requests.
  • Hardware needs (GPUs, Spot, Arm) are requested with ComputeClasses, without configuring nodes.
  • In Autopilot, all Pod traffic goes through VPC firewall rules, even between Pods in the cluster.
# 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

Regional, zonal, and multi-zonal clusters

TypeControl planeDefault nodes
RegionalReplicas across zones in the region: stays available if a zone fails and during upgradesMulti-zonal (three zones)
ZonalOne, in a single zone. Workloads keep running if it fails, but you can't configure the cluster until it is backA single zone (can become multi-zonal)
  • Google recommends regional clusters for production.
  • A regional cluster can't be changed to zonal later.
  • The default node pool of a regional Standard cluster has nine nodes (three per zone); you can reduce it to one per zone. New billing accounts get only eight in-use IP addresses per region, so creation can fail on quota.
  • Node-to-node traffic across zones is charged.
  • For GPUs in a regional cluster, use --node-locations to specify zones that have that GPU.
  • If you add persistent storage without specifying a zone, GKE puts the zonal disk in a random zone.

Private clusters: network isolation

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

  • DNS-based endpoint (recommended): a unique, immutable FQDN per cluster, reachable from any network that can reach Google APIs. Protected with IAM and optionally VPC Service Controls. No bastions or proxies.
  • IP-based endpoints: public or internal, with authorized networks (a list of CIDR blocks allowed to connect).

Private nodes

  • Nodes have only internal IPs and aren't reachable from the internet.
  • Without NAT they can't reach the internet: turn on Cloud NAT.
  • Enabled at the cluster, node pool (Standard), or workload (Autopilot) level, and changeable at any time.
  • In a Shared VPC you must enable Private Google Access manually.

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.

Release channels

GKE upgrades every cluster automatically. The channel sets the balance between new features and stability; maintenance windows and exclusions control when it happens.

ChannelWhat for
RapidThe 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
StablePrioritizes stability; gets changes last
ExtendedLong-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.

Deploying a containerized application

The official quickstart flow: enable the GKE and Artifact Registry APIs, have the roles/container.admin role, create the cluster, and deploy.

1

Create the cluster: gcloud container clusters create-auto hello-cluster --location=us-central1

2

Create a Deployment: kubectl create deployment hello-server --image=IMAGE (for example, from Artifact Registry)

3

Expose it: kubectl expose deployment hello-server --type LoadBalancer --port 80 --target-port 8080, which creates a Compute Engine load balancer

4

Check: kubectl get pods and kubectl get service hello-server to see the EXTERNAL-IP

  • For production, use declarative YAML manifests with kubectl apply -f instead of imperative commands.
  • A LoadBalancer Service gets an ephemeral external IP; to use a static IP you already reserved, set it in loadBalancerIP. Autopilot doesn't support externalIps.
  • Google's best practice: use Cloud Build, Cloud Deploy, and Artifact Registry for CI/CD.

Exam scenarios

SituationAnswerWhy
The team doesn't want to manage nodes and wants to pay only for what Pods requestGKE AutopilotGoogle manages nodes; you pay for requested resources.
You need Windows Server nodes or Cloud Marketplace appsGKE StandardAutopilot supports neither.
The control plane must stay available if a zone failsRegional clusterReplicates the control plane across zones.
Nodes must have no public IPs but still download packages from the internetPrivate nodes + Cloud NATWithout NAT there is no internet egress.
kubectl must point to the cluster a colleague just createdgcloud container clusters get-credentialsAdds the kubeconfig entry and switches context.
Keep a Kubernetes minor version for as long as possibleExtended channelLong-term support.
Expose a Deployment to the internet with an external IPkubectl expose --type LoadBalancerCreates a Compute Engine load balancer.

Common exam traps

❓ 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?

Ready to test "GKE clusters"?

Original questions, each with a full explanation.

Start a mock exam