Prepare and test your skills
Prepare and test your skills
Evaluating operational complexity and infrastructure control means comparing how much Google manages against how much the team must configure and operate. Google Kubernetes Engine (GKE) (opens in a new tab) keeps Kubernetes-level control with the team in exchange for more administration, while Cloud Run (opens in a new tab) hides servers and clusters to reduce daily operations. Cloud Run functions (opens in a new tab) extends that serverless model to small, event-driven code that runs inside Cloud Run.
Google Kubernetes Engine (GKE) is a managed Kubernetes platform for deploying, scaling, and orchestrating containerized applications. Google manages the Kubernetes control plane for security and availability, while the team manages the cluster itself, including node configuration, networking, scaling, and upgrades. This ownership split means failures or patches in the control plane are Google-owned, while workload placement, cluster upgrades, and policy configuration remain team-owned.
GKE offers two modes that change the amount of infrastructure work. In Autopilot mode, Google provisions nodes, adjusts capacity, enforces a default security posture, and the team pays only for resources requested by workloads. In Standard mode, the team manages node pools directly and keeps control over the virtual machines that serve as Kubernetes nodes. For capacity changes, GKE adds or removes containers with the Horizontal and Vertical Pod Autoscalers, adds or removes nodes with the cluster autoscaler, and orchestrates batch jobs through Kueue.
Cloud Run serverless abstraction means the team provides code or a container image and Google operates everything underneath it. Google manages the operating system, kernel, network setup, and capacity, so the team never creates, provisions, or upgrades a cluster. When code is deployed from source, Cloud Run can build the container image automatically.
Cloud Run supports three related patterns. Cloud Run services run code that responds to web requests, Cloud Run jobs run code that performs background tasks and then exits, and Cloud Run functions run single lightweight functions for event-driven work. Traffic flows from an incoming request or event to Cloud Run, which starts container instances, routes work to them, and scales instances up or down based on requests or CPU use. Operational work therefore shifts from server care to service settings such as environment variables, concurrency, and network connections.
Resource isolation, custom configuration, and operational overhead are the practical differences between GKE and Cloud Run. GKE provides Kubernetes-level isolation and customization through Pods, namespaces, node configurations, network policies, security settings, and add-ons. GKE also supports both stateless and stateful applications because persistent data can survive restarts through attached volumes. Cloud Run provides Google-managed isolated container instances with limited infrastructure customization and fits stateless, request-driven or event-driven services, web APIs, batch jobs, and functions.
The following comparison summarizes the management tradeoff:
| Feature | GKE | Cloud Run |
|---|---|---|
| Deployment and management | Team manages clusters, including nodes, networking, scaling, and upgrades | Team provides source or image; no cluster or infrastructure provisioning |
| Control and flexibility | Full control over nodes, network policies, security, and add-ons | Limited control to environment variables, concurrency, and network connections |
| Application types | Stateless and stateful apps, including complex microservices | Stateless request-driven or event-driven services, jobs, and functions |
| Pricing model | Pay-per-cluster per hour, irrespective of mode, size, or topology | Pay-per-use, rounded up to the nearest 100 milliseconds |
Choose GKE when the workload needs persistent state, custom storage, complex dependencies, or deep Kubernetes networking control. Choose Cloud Run when the workload fits stateless web traffic or events and benefits from automatic scaling and paying only during execution.
Exam tip: Choose Cloud Run when no explicit Kubernetes requirement exists, and choose GKE when the workload needs stateful storage, custom node or network configuration, or Kubernetes APIs.
Differentiating compute services by workload archetype means matching how work is triggered, scaled, and operated to the right platform. Cloud Run functions (opens in a new tab) handle lightweight event-driven triggers, Cloud Run (opens in a new tab) runs containerized services and jobs that scale on requests, and Google Kubernetes Engine (GKE) orchestrates complex, distributed, and stateful applications. Google manages all infrastructure for Cloud Run, while GKE splits ownership with Google managing the control plane and the team managing clusters and workloads.
Cloud Run functions are lightweight, single-purpose code units that run inside the Cloud Run serverless platform and respond to events from other Google Cloud services. An event flows from its source, such as a storage change, message, or schedule, to the function, and the function then starts work. A common pattern is for the function to initiate a larger workflow, such as starting a batch processing job that runs on Cloud Run. Choose Cloud Run functions when work should start only when something happens, run briefly, and then stop.
Cloud Run for containerized request-based scaling is a serverless way to run applications without managing clusters or servers. The team provides source code, a function, or a container image, and Google manages the operating system, kernel, network setup, and capacity. Cloud Run supports services for code that responds to web requests and jobs for code that performs background tasks and then exits.
Traffic flow drives Cloud Run scaling. Incoming requests or CPU consumption flow into the Cloud Run control plane, which starts additional container instances as load rises and removes instances as load falls without manual intervention. This model fits stateless web applications, mobile backends, APIs, and periodic batch jobs with variable traffic. Billing is pay-per-use rounded up to the nearest 100 milliseconds, and Cloud Run supports NVIDIA RTX PRO 6000 Blackwell and L4 GPUs but does not support other GPU models or Google TPUs.
Google Kubernetes Engine (GKE) for complex orchestration is a managed Kubernetes platform that runs containerized applications across a cluster of nodes. Google manages the Kubernetes control plane for security and availability, while the team manages node configuration, networking, scaling, upgrades, and application objects. In Autopilot mode Google also provisions nodes and adjusts capacity, while in Standard mode the team manages node pools directly.
Orchestration in GKE works at two levels that depend on each other. At the pod level, the Horizontal Pod Autoscaler and Vertical Pod Autoscaler add or remove containers and adjust their resources, and Kueue orchestrates batch jobs through queues. At the node level, the cluster autoscaler adds or removes nodes to fit the pods that need placement. GKE supports stateless and stateful applications, persistent storage with attached volumes, fine-grained resource allocation, network policies, and all available NVIDIA GPUs and all available Google TPUs. Pricing is pay-per-cluster per hour regardless of mode, size, or topology.
Choosing between the three archetypes depends on trigger type, state, and control needs. Both Cloud Run and GKE use standard container images, so the same image stored in Artifact Registry can run on either platform without modification. Both also integrate with Cloud Logging, Cloud Monitoring, Cloud Deploy, and Binary Authorization, which enables a hybrid design with a stateless frontend on Cloud Run and a stateful service on GKE.
A decision tree that starts with a workload and branches on trigger type, statefulness, and control needs to recommend Cloud Run functions, Cloud Run, or GKE, with pricing and scaling notes on each leaf.
| Option | Trigger and scaling signal | Best-fit workload |
|---|---|---|
| Cloud Run functions | Cloud event starts a lightweight function, which starts downstream work | Event-driven tasks, such as starting a Cloud Run job when data arrives |
| Cloud Run | Incoming HTTP requests or CPU use adds or removes instances automatically | Stateless web services, APIs, and batch jobs with spiky traffic |
| Google Kubernetes Engine (GKE) | Pod autoscalers adjust containers and cluster autoscaler adjusts nodes | Stateful services and complex microservices needing custom nodes, storage, or networking |
Exam tip: Choose Cloud Run and Cloud Run functions for stateless, request-driven or event-driven work with automatic scaling, and choose GKE when the workload is stateful or needs Kubernetes-level control over pods, nodes, storage, and networking.
Assessing scalability, portability, and economic trade-offs means comparing how platforms handle demand changes, move workloads, and charge for resources. Cloud Run (opens in a new tab) is a serverless platform where Google manages the operating system, kernel, network setup, and capacity, while Google Kubernetes Engine (GKE) (opens in a new tab) is a managed Kubernetes platform where Google manages the control plane and the team manages cluster configuration. The choice changes how traffic flows from clients to containers, how quickly capacity appears and disappears, and whether cost follows actual use or reserved capacity.
How scaling behaves on each platform determines which demand pattern each service fits. For Cloud Run web services, traffic flows from the client to the Cloud Run service, and Google starts container instances to handle requests and removes instances when requests or CPU consumption drops. Work can run as a web service, asynchronous task, or batch job, and Cloud Run functions can trigger event-driven work such as starting batch jobs. This model fits stateless, request-driven services that spike and then go idle because capacity follows requests.
GKE scaling uses Kubernetes orchestration with separate pod and node controls. Demand flows from clients to Kubernetes Services and Deployments, and GKE adds or removes containers with the Horizontal and Vertical Pod Autoscalers and adds or removes nodes with the cluster autoscaler. In Autopilot mode Google manages nodes and capacity adjustments, while in Standard mode the team manages node pools for fine-grained control over configuration, network policies, and allocation. This model fits complex microservices and stateful services that need persistent volumes and must stay available with controlled placement.
Container portability between GKE and Cloud Run is high because both platforms use standard container images as deployment artifacts. The same image stored in Artifact Registry can run on either platform without modification, so migration does not require rebuilding the application. Both platforms also use a declarative API model, where the Cloud Run Admin API v1 is designed to be compatible with the Kubernetes API, so concepts such as Deployments, Services, and horizontal autoscalers translate more easily.
Portability is supported by shared operations and traffic tools that let one application span both runtimes:
Traffic can shift gradually because external and internal load balancers can sit in front of services on both platforms. Requests flow from the load balancer to GKE endpoints, to Cloud Run endpoints, or split across both, which enables testing on one platform with rollback by changing routing. For private access, a Cloud Run service can reach a GKE cluster over a Virtual Private Cloud (VPC) network using Direct VPC egress, while the Kubernetes Service uses an internal passthrough Network Load Balancer.
Cost models and utilization trade-offs depend on how often resources are idle and how long execution lasts. Cloud Run uses pay-per-use billing rounded up to the nearest 100 milliseconds, so cost flows directly from request volume and container run time. When users are browsing or a batch job is executing, metered instances accrue charges, and when traffic stops, instances scale down and charges stop. This makes Cloud Run efficient for spiky, intermittent, or event-driven work.
GKE uses a cluster-based model with pay-per-cluster per hour plus the cost of underlying node capacity. Nodes and pods remain available to serve steady traffic and persistent state, so a predictable workload can use reserved capacity more efficiently than paying per request. If utilization is constant and autoscaling is rarely needed, the fixed cost of GKE nodes can be more attractive than Cloud Run pay-per-use billing. The decision therefore depends on whether the workload is idle much of the time, spiky with sharp peaks, or steady with consistent demand.
| Platform | Scaling trigger | Best application fit | Pricing behavior |
|---|---|---|---|
| Cloud Run | Automatic based on incoming requests or CPU consumption | Stateless web services, APIs, event-driven functions, and batch jobs | Pay-per-use rounded to nearest 100 milliseconds; cost follows execution duration |
| Google Kubernetes Engine (GKE) | Pod scaling with HPA and VPA plus node scaling with cluster autoscaler | Stateful services and complex microservices needing custom nodes or networking | Pay-per-cluster per hour plus node capacity; cost follows reserved cluster size |
Exam tip: Choose Cloud Run when demand is spiky or idle periods are long and cost should stop when requests stop; choose GKE when demand is steady and persistent capacity with Kubernetes control costs less than per-request billing.
Choose Google Kubernetes Engine (GKE) when the workload needs persistent state, custom storage, complex dependencies, or deep Kubernetes networking control. Choose Cloud Run when the workload fits stateless web traffic or events and benefits from automatic scaling and paying only during execution.
Google Kubernetes Engine (GKE) is a managed Kubernetes platform where Google manages the Kubernetes control plane for security and availability while the team manages node configuration, networking, scaling, and upgrades. Cloud Run is a serverless platform where the team provides code or a container image and Google manages the operating system, kernel, network setup, and capacity, so the team never creates, provisions, or upgrades a cluster.
Cloud Run starts container instances based on incoming requests or CPU consumption and uses pay-per-use billing rounded up to the nearest 100 milliseconds, so charges stop when instances scale down. Google Kubernetes Engine (GKE) adds or removes containers with the Horizontal and Vertical Pod Autoscalers and adds or removes nodes with the cluster autoscaler, and uses pay-per-cluster per hour plus the cost of underlying node capacity.
Cloud Run functions are lightweight, single-purpose code units that run inside the Cloud Run serverless platform and respond to events from other Google Cloud services. Choose Cloud Run functions when work should start only when something happens, run briefly, and then stop, such as starting a Cloud Run job when data arrives.
A company has developed a custom containerized API packaged as a standard OCI container image. The workload exhibits highly sporadic and unpredictable traffic patterns throughout the day, often experiencing several consecutive hours of zero incoming traffic.
The architecture team has established the following operational and economic requirements:
Which architecture should the cloud architect recommend?
Deploy the container using Compute Engine managed instance groups (MIGs) with schedule-based autoscaling
Deploy the container to a Google Kubernetes Engine (GKE) Autopilot cluster and configure the Horizontal Pod Autoscaler (HPA) to scale deployment replicas to zero
Deploy the container to Cloud Run with CPU allocated only during request processing and enable Startup CPU Boost
Refactor the service logic into Cloud Run functions triggered by HTTP requests with minimum instances set to zero
Last updated