Prepare and test your skills
Prepare and test your skills
GKE cluster architecture and management modes are the choices that decide who manages nodes and where the control plane and nodes run. Google Kubernetes Engine (GKE) (opens in a new tab) is a managed service to deploy, manage, and scale containerized workloads on Kubernetes. GKE builds on top of Compute Engine (opens in a new tab), so Compute Engine practices for load balancing, autoscaling, reservations, and storage partly apply to GKE nodes.
GKE Standard and Autopilot modes define the split of responsibility between Google Cloud and the cluster operator. GKE Standard gives advanced configuration flexibility where the operator defines node pools, machine types, and scaling behavior for production workloads. GKE Autopilot provides a fully provisioned and pre-configured cluster where GKE dynamically manages nodes, node operating system updates, and system overhead.
The two modes trade operational overhead, billing, and control:
| Mode | Node management | Billing | Configuration choice | Best fit |
|---|---|---|---|---|
| GKE Standard | Operator configures node pools, upgrades nodes with GKE automation, and tunes bin-packing | Billed for Compute Engine virtual machine (VM) infrastructure backing each node, regardless of workload use | Full choice of zonal or regional clusters, node shapes, and networking | Workloads needing custom nodes, specific hardware, or direct infrastructure control |
| GKE Autopilot | GKE manages nodes automatically; operator only defines workload requests | Billed only for CPU, memory, and ephemeral storage requested by running Pods | Fewer choices; all clusters are regional with an optimized configuration | Workloads where low management overhead and efficient use without bin-packing matter |
In Standard, efficient bin-packing is essential because empty capacity on a VM is still billed. In Autopilot, charges follow requested Pod capacity, so the operator does not need to monitor packing efficiency. GKE monitors Standard clusters through Recommender (opens in a new tab) with type google.container.DiagnosisInsight and subtype CLUSTER_AUTOPILOT_OPTIMIZATION, and it generates a migration insight when node CPU requested by workloads is less than 55% of total available node CPU.
Regional and zonal control planes define where the Kubernetes control plane runs and what survives a zonal failure. A regional cluster (opens in a new tab) runs multiple control plane replicas across multiple zones within one Google Cloud region, and its nodes can run in a single zone or across multiple zones in that region. A zonal cluster, available only in Standard mode, runs a single control plane in a single zone, with nodes that can run in one zone or in multiple zones of the same region.
Workloads in a zonal cluster keep running during an upgrade or outage of the control plane zone, but the cluster, its nodes, and its workloads cannot be configured until the control plane is available again. Regional clusters offer higher availability and different service level agreements (SLAs) than zonal clusters, so regional clusters are recommended for production workloads. All Autopilot clusters are regional, and a cluster region cannot be changed after creation without creating a new cluster and migrating traffic.
Exam tip: Autopilot clusters are always regional, while Standard clusters can be regional or zonal; choose regional when high availability of the control plane matters.
Node location defines where Pods can run inside the cluster region. A single-zone cluster runs all nodes and workloads in only one zone, so a zonal outage makes all workloads unavailable. A multi-zonal cluster distributes nodes across multiple zones within a single region, so a workload spread across zones is disrupted in the failed zone but remains available in the other zones.
By default, GKE replicates each node pool in a regional cluster across three zones of the control plane region, and the operator can narrow a regional Standard cluster to a single zone or specific zones. Zonal clusters are created by default as single-zone clusters but can be updated to multi-zonal, while regional clusters are created by default as multi-zonal but can be updated to single-zone. Distributing nodes across zones can incur charges for cross-zone network egress when nodes communicate with peers in a different zone in the region. For existing Standard clusters, zones can be added or removed, but nodes are immediately added or removed, so workloads in a removed zone must be prepared for disruption.
Cluster administration separates Google Cloud lifecycle tasks from Kubernetes-internal behavior. Google Cloud tools and APIs (opens in a new tab), including the Google Cloud console, Google Cloud CLI, and GKE API, control creating, viewing, updating, deleting, and managing Identity and Access Management (IAM) access. The Kubernetes API and kubectl control internal behavior such as deploying workloads and applying role-based access control (RBAC) and network policies, while Terraform can declaratively provision both clusters and workloads.
By default, GKE automatically upgrades control planes and nodes to deliver security updates and supported Kubernetes versions, with release channels and maintenance windows for control over timing. Autopilot handles most administration including upgrades and node configuration, while in Standard only upgrades are managed and the operator retains node responsibility. Deploying multiple GKE clusters in a fleet can increase flexibility and availability, for example by adding a new cluster to adopt a feature that requires cluster creation and then moving workloads before deleting the old cluster, at the cost of increased complexity.
Network connectivity and security posture in Google Kubernetes Engine (GKE) (opens in a new tab) is the design of how traffic moves into, out of, and between workloads while allowing only what is necessary. By default the network inside a GKE cluster is open, which means every Pod can communicate with every other Pod. A secure posture moves that default-open network to least-privileged interaction through stable internal endpoints, managed external entry points, Pod-level isolation, and identity controls.
Security principles for GKE networking pursue workload isolation and secure multi-tenancy through fine-grained, Kubernetes-aware traffic control. Least privilege means granting systems and services only the minimum network access and permissions required for their functions, which reduces the impact if one workload is compromised. Defense in depth and actionable data complete the approach by layering independent controls and using observed traffic to guide decisions.
The three guiding principles work together in practice:
Together these principles turn connectivity choices into enforceable boundaries between microservices, namespaces, and tenants.
Kubernetes Services (opens in a new tab) provide stable network endpoints for groups of Pods selected by labels, so microservices communicate with a Service name rather than changing Pod IP addresses. A Service keeps internal traffic inside the cluster boundary, while external access is exposed through controlled entry points instead of exposing Pods directly. This separation lets operators apply different rules to east-west traffic between Pods and north-south traffic entering from the internet.
Ingress in GKE manages external HTTP and HTTPS access through the GKE ingress controller. Traffic flows in a fixed order:
The GKE ingress controller reads the Kubernetes Ingress object to configure the load balancer, which keeps the desired routing and the provisioned infrastructure aligned. For additional protection at this boundary, Cloud Armor attaches IP allow lists, deny lists, and security policies to GKE-hosted applications, and Identity-Aware Proxy (IAP) can be integrated through Ingress to control application-level access.
Exam tip: The cluster network starts open with Pod-to-Pod communication allowed, so restriction requires an explicit NetworkPolicy; Ingress and Cloud Armor do not replace Pod-level isolation.
NetworkPolicy (opens in a new tab) is the standard Kubernetes resource for controlling communication between Pods within a cluster using Pod labels and namespaces. A NetworkPolicy defined by an application developer applies within its namespace and specifies allowed ingress rules for incoming traffic to selected Pods and egress rules for outgoing traffic from those Pods. Once a policy selects a Pod, only the connections explicitly allowed by the policy are permitted in the directions the policy covers, which moves that workload from default-open to least-privileged communication.
NetworkPolicy depends on the cluster network implementation to enforce its rules, and its effectiveness depends on complete ingress and egress definitions for the application. A common pattern is to isolate a sensitive backend, where traffic flows only from the labeled frontend Pods to the database Pods on the required port, and all other Pod sources are denied. Because the policy applies to labels rather than IP addresses, the isolation follows the workload even as individual Pods are rescheduled and replaced.
ClusterNetworkPolicy (opens in a new tab) is the Kubernetes-native cluster-scoped resource for administrative enforcement across all namespaces in GKE. ClusterNetworkPolicy is managed by a cluster administrator rather than an individual application team, so guardrails set at the cluster boundary apply even when namespace teams manage their own NetworkPolicy objects. This resource is supported on clusters running GKE version 1.36.1-gke.1067000 or later, and it provides a hierarchical approach where administrator policy sits above namespace policy.
The policy choices for Pod-to-Pod control differ by scope, owner, and purpose:
| Policy | Scope | Managed by | Choose when |
|---|---|---|---|
| NetworkPolicy | Single namespace | Application developer | The work needs ingress and egress rules for one application within its namespace |
| ClusterNetworkPolicy | All namespaces | Cluster administrator | The work needs mandatory guardrails with the Admin tier or zero-trust defaults with the Baseline tier |
| CiliumClusterwideNetworkPolicy | Cluster-wide | Cluster administrator | Specialized cluster-wide control exists on legacy deployments; for new deployments use ClusterNetworkPolicy instead |
Hierarchical evaluation means administrator tiers establish the non-overridable baseline, while namespace policies add application-specific allowances inside that boundary. For new designs, the proprietary CiliumClusterwideNetworkPolicy is not the preferred path because new deployments are directed to the Kubernetes-native ClusterNetworkPolicy.
Workload Identity Federation for GKE (opens in a new tab) is the mechanism for giving Pods access to Google Cloud resources without sharing broad node credentials. The need for this control comes from an important identity boundary: Kubernetes service accounts are created and managed by Kubernetes and belong to one cluster, while Google Cloud service accounts are Google Cloud identities used for Google Cloud APIs. A Pod presents its Kubernetes service account, GKE maps that identity to a specific Google Cloud service account, and Google Cloud then authorizes only the API actions granted to that mapped account.
This mapping enforces least privilege for service-to-service and service-to-API interaction across the cluster-to-cloud boundary. Instead of using the default node service account for all workloads, each workload uses a least-privilege Identity and Access Management (IAM) service account that holds only the roles its task requires. Role-based access control (RBAC) complements this by defining how Google users, Google groups, and service accounts can interact with Kubernetes objects such as deployments, ConfigMaps, Pods, and logs, scoped to a cluster or a single namespace. Private GKE nodes, authorized networks for the control-plane endpoint, VPC-native alias IP ranges for anti-spoofing, and IP masquerading for address translation further reduce exposure by keeping node addresses private and limiting which networks can reach the cluster.
Workload scaling and resource optimization in Google Kubernetes Engine (GKE) (opens in a new tab) is the practice of automatically matching Pod and node capacity to changing traffic while balancing reliability and cloud spending. GKE uses separate autoscaling controllers for workloads and infrastructure, so replica count, container size, and node count can each expand during surges and contract during quiet periods. For small sandbox or development environments, GKE Autopilot dynamically manages nodes and bills only for requested Pod capacity, which avoids virtual machine (VM), node operating system, and system overhead charges.
The Horizontal Pod Autoscaler (HPA) (opens in a new tab) is the workload controller that changes the number of Pod replicas by scaling out when load rises and scaling in when load falls. The HPA watches real-time utilization against a target threshold, and the controller adds replicas when utilization stays above target and removes replicas when it stays below target. For this measurement to work, the Deployment must set a CPU resource request, and a target such as 70% or 80% leaves buffer capacity to handle surges while new Pods start.
The HPA can scale on built-in metrics or on application-specific signals, but custom signals require a metrics pipeline that exposes them to the HPA. Three metric sources cover most needs:
When custom metrics are used, data flows from the application to Cloud Monitoring, through the Custom Metrics - Stackdriver Adapter into the Kubernetes custom metrics API, and then to the HPA, which adjusts the Deployment replica count.
The Vertical Pod Autoscaler (VPA) is the workload controller that changes the size of a Pod by adjusting container CPU and memory requests to match actual usage. The VPA analyzes historical consumption rather than current load, so it increases requests to prevent resource contention when a Pod is under-provisioned and decreases requests to reduce waste when a Pod is over-provisioned. Use the VPA for workloads that do not use the HPA or when peak workload is unknown and initial requests are only a guess.
Safe adoption of the VPA depends on observation first and limits second. Keep the VPA in Off recommendation-only mode for at least 24 hours, ideally one week, in a production-like environment to capture representative traffic patterns. Then specify explicit minimum and maximum bounds in the VerticalPodAutoscaler object before enabling Initial or Auto modes, which prevents erratic sizing adjustments from an unbounded recommendation.
The Cluster Autoscaler is the infrastructure controller that adds and removes nodes in GKE Standard node pools based on scheduling simulation rather than CPU load. When pending Pods cannot be scheduled on existing nodes, the Cluster Autoscaler provisions nodes to fit them; when nodes become underutilized after Pods scale in or move, it consolidates workloads and scales nodes down. Specify minimum node parameters to preserve baseline night capacity, so the cluster never scales below the capacity needed for steady-state services.
Safe scale-down depends on the PodDisruptionBudget (PDB), a policy object that limits how many Pods of a service can be unavailable at once. Always configure a PDB for system and application Pods, because the Cluster Autoscaler must evict Pods when it consolidates or removes underutilized nodes. Related node pool auto-creation automatically generates custom node pools whose shape, CPU count, or memory limits fit the scheduling parameters of Pending Pods, which minimizes leftover capacity on oversized nodes and fulfills specialized requests such as GPUs or a ComputeClass.
How the autoscalers work together is a division of labor by layer rather than competition. The three autoscalers answer different scaling questions, so replica count, container size, and node count are controlled independently:
| Autoscaler | Reacts to | Scales what | Scaling trigger |
|---|---|---|---|
| Horizontal Pod Autoscaler (HPA) | Current load | Number of Pod replicas | Real-time CPU, RPS, or custom metric stays above or below target |
| Vertical Pod Autoscaler (VPA) | Sizing efficiency | CPU and memory requests per Pod | Historical average usage shows requests are too high or too low |
| Cluster Autoscaler | Schedulability | Number of nodes in node pools | Pending Pods cannot schedule, or nodes are underutilized |
In a traffic surge, the flow moves from workload to infrastructure in order: first the HPA increases replicas, then the Kubernetes scheduler attempts to place the new Pods, and only after Pods remain Pending does the Cluster Autoscaler add nodes. The shared dependency for built-in workload scaling is Metrics Server, which retrieves container metrics from kubelets and exposes them through the Metrics API for the HPA and VPA to read.
A four-step left-to-right flow showing traffic surge triggering HPA to add Pod replicas, scheduler attempting placement, and Cluster Autoscaler adding nodes only if Pods stay Pending, ending with Pending Pods scheduled.
Exam tip: The HPA changes Pod count, the VPA changes Pod size, and the Cluster Autoscaler changes node count; use the VPA for workloads that do not already use the HPA on the same CPU or memory metrics.
Google Kubernetes Engine Standard mode leaves node pools, machine types, and scaling behavior to the operator and bills for the Compute Engine virtual machine infrastructure backing each node regardless of workload use, while Autopilot mode has Google Kubernetes Engine manage nodes automatically and bills only for CPU, memory, and ephemeral storage requested by running Pods. Standard offers full choice of zonal or regional clusters, node shapes, and networking for workloads needing custom nodes or direct infrastructure control, while all Autopilot clusters are regional with an optimized configuration for low management overhead without bin-packing.
Regional clusters run multiple control plane replicas across multiple zones within one region and are recommended for production workloads because they offer higher availability and different service level agreements than zonal clusters, while zonal clusters run a single control plane in a single zone and are available only in Standard mode. All Autopilot clusters are regional, and a cluster region cannot be changed after creation without creating a new cluster and migrating traffic.
NetworkPolicy controls Pod-to-Pod communication in Google Kubernetes Engine by selecting Pods with labels and namespaces and permitting only explicitly allowed ingress for incoming traffic and egress for outgoing traffic in the directions the policy covers. The cluster network starts open with every Pod able to communicate with every other Pod, so applying a NetworkPolicy moves the selected workloads to least-privileged communication where isolation follows the workload even as Pods are rescheduled.
The Horizontal Pod Autoscaler changes the number of Pod replicas in response to current load such as real-time CPU, requests-per-second, or custom metrics, the Vertical Pod Autoscaler changes CPU and memory requests per Pod in response to historical usage showing requests are too high or too low, and the Cluster Autoscaler changes the number of nodes in node pools when pending Pods cannot be scheduled or when nodes are underutilized. In a traffic surge the Horizontal Pod Autoscaler first increases replicas, then the scheduler attempts placement, and only after Pods remain Pending does the Cluster Autoscaler add nodes.
An e-commerce company runs an order processing application on Google Kubernetes Engine (GKE). The application experiences sudden, sharp traffic surges during flash sales and low activity overnight. The engineering team has identified the following requirements:
Which autoscaling architecture should you implement to satisfy these requirements?
Last updated