Prepare and test your skills
Prepare and test your skills
Analyze Infrastructure Control versus Managed Service Trade-offs is the choice between managing your own infrastructure and letting Google manage it for you. Compute Engine (opens in a new tab) gives maximum control as Infrastructure as a Service (IaaS), Google Kubernetes Engine (GKE) (opens in a new tab) gives managed container orchestration as Container as a Service (CaaS), and Cloud Run (opens in a new tab) gives fully managed serverless containers. As control decreases from Compute Engine to GKE to Cloud Run, Google takes over more of the operating system (OS), scaling, and cluster lifecycle.
Infrastructure control with Compute Engine virtual machines means you control the guest OS, middleware, and applications on virtual machine (VM) and bare metal instances. Google manages virtualization, physical servers, storage, and networking underneath, while you choose the machine series, storage, accelerators, and guest OS. You can add graphics processing units (GPUs) or tensor processing units (TPUs) and customize processors, memory, and networking.
This control makes Compute Engine the choice when a workload needs a custom OS, kernel modification, specialized networking, or manual software installation. The tradeoff is the highest operational overhead because you set up, maintain, update, and scale each instance yourself. Scaling is manual or automatic with managed instance groups (MIGs), and orchestration is manual unless you install your own orchestrator such as Slurm.
Managed orchestration with GKE Autopilot and Standard modes means Google manages the Kubernetes control plane for security and availability while you deploy container workloads. GKE supports all available NVIDIA GPUs and all available Google TPUs for containerized workloads. Capacity adjusts with the Horizontal and Vertical Pod Autoscalers, the cluster autoscaler, and batch orchestration through Kueue.
Responsibility for nodes and the OS depends on GKE mode. In Autopilot mode, Google manages the OS, cluster nodes, and capacity adjustments without manual intervention. In Standard mode, Google still manages the OS, but you manage node pools and can choose Container-Optimized OS by default or Ubuntu as an option. Choose GKE when you need robust orchestration, automatic pod and node scaling, and portability for distributed applications or microservices without managing VMs directly.
Fully managed serverless operation with Cloud Run means Google manages infrastructure, OS, and runtime environments with no servers or clusters to configure. You deploy a container that responds to web requests or events, and traffic flows from the incoming request to an automatically provisioned container instance. Cloud Run scales automatically based on requests or CPU consumption and can scale to zero between requests.
Accelerator support in Cloud Run is limited to NVIDIA RTX PRO 6000 Blackwell and L4 GPUs, with no TPU support. This limit reflects its focus on request-driven services rather than large training clusters. Choose Cloud Run when you want minimal operational overhead, rapid deployment, and automatic scaling instead of custom OS control.
Exam tip: Choose Compute Engine when the workload needs self-managed OS and kernel control, and choose Cloud Run when the workload can run in a Google-managed container that scales automatically on requests.
Comparison of control, overhead, and scaling behavior shows who manages the OS, how work is orchestrated, and how capacity changes:
| Compute option | OS and kernel control | Orchestration | Scaling |
|---|---|---|---|
| Compute Engine | Self-managed | Manual or custom orchestrator | Manual or automatic by using MIGs |
| Google Kubernetes Engine (GKE) | Google-managed in Autopilot; semi-managed in Standard where you manage node pools | Kubernetes | Automatic pod and node scaling |
| Cloud Run | Google-managed | Serverless | Automatic based on requests or CPU consumption |
Greater control in Compute Engine supports custom environments but requires manual maintenance and scaling design. GKE shifts control-plane and node automation to Google while workload orchestration stays with you. Cloud Run removes infrastructure operations entirely, so effort flows directly from code and container to serving traffic.
Execution Context and Runtime Constraints describe who manages the environment and how long and in what form code is allowed to run. Cloud Run (opens in a new tab) provides a serverless context where Google manages the OS, kernel, network setup, and capacity, while Compute Engine (opens in a new tab) provides an instance-based context where you manage VMs and bare metal instances. Google Kubernetes Engine (GKE) (opens in a new tab) sits between them as an orchestrated container context where Google manages the Kubernetes control plane and you manage container workloads.
Serverless execution on Cloud Run services and jobs means you package workloads as containers and run them without server or cluster management. Cloud Run services handle code that responds to web requests, and Cloud Run jobs handle code that performs background tasks and then exits. Google starts, runs, and scales container instances without manual intervention, and web services add or remove instances based on incoming requests or CPU consumption.
The Cloud Run execution context minimizes overhead because Google handles the OS, kernel, network setup, and capacity management. Billing follows a pay-per-use model rounded up to the nearest 100 milliseconds, so you pay only for resources used during request handling or job execution. The tradeoff is limited infrastructure control and constrained runtime, including support for only NVIDIA RTX PRO 6000 Blackwell and L4 GPUs with no support for other GPU models or Google TPUs.
Instance-based execution on Compute Engine virtual machines means you retain complete control over the OS, kernel settings, boot files, processors, memory, storage types, and guest OS. You can attach NVIDIA GPUs and Google TPUs and select from general-purpose, compute-optimized, memory-optimized, storage-optimized, network-optimized, and accelerator-optimized machine families. VMs support long-lived processes, stateful workloads that need fixed IP addresses, and full control over start, stop, suspend, and resume behavior.
Orchestration in Compute Engine is manual, so reliability and scale depend on your configuration. You set up instances, network rules, traffic routes, and backup systems, and you scale by adding or removing instances directly, using custom tools, or configuring MIGs. VMs and containers in this model provide more configuration flexibility, but you are responsible for managing the resources.
Orchestrated container execution on GKE clusters means Google manages the Kubernetes control plane for security and availability while your containers run as workloads. In Autopilot mode Google manages cluster nodes and capacity adjustments without manual intervention, while in Standard mode you manage cluster node pools. GKE supports NVIDIA GPUs and Google TPUs and supports both stateless and stateful applications.
Scaling in GKE flows from workload demand through Kubernetes autoscalers to cluster capacity. The Horizontal and Vertical Pod Autoscalers add or remove containers, the cluster autoscaler adds or removes nodes, and Kueue orchestrates batch jobs through queueing. GKE Autopilot commonly supports long-lived or stateful workloads that do not fit Cloud Run, including complex microservices with specific resource needs, custom storage, and fine-grained resource allocation.
Runtime constraints and platform selection guide starts from whether the workload can live within a managed, short-duration, stateless context or needs persistent or customized execution:
| Platform | Execution ownership | Scaling behavior | Workload fit |
|---|---|---|---|
| Cloud Run | Google manages OS, kernel, network, and capacity | Google adds or removes instances based on requests or CPU | Stateless, request-driven or event-driven services and jobs that exit when done |
| Google Kubernetes Engine (GKE) | Google manages control plane; Autopilot manages nodes, Standard leaves node pools to you | HPA and VPA adjust containers, cluster autoscaler adjusts nodes | Stateless and stateful apps, complex microservices, and long-lived workloads |
| Compute Engine | You manage OS, kernel, boot files, machine type, and network rules | You add or remove instances manually, with custom tools, or with MIGs | Apps needing custom architecture, specialized kernel settings, and full VM control |
Traffic can flow from external clients through load balancing, Virtual Private Cloud (VPC) networking, Identity-Aware Proxy, and Google Cloud Armor to services on either Cloud Run or GKE. The same standard container image can run on both platforms. Use serverless first when the workload is stateless and event-driven, and move to GKE or Compute Engine when state, duration, accelerators, or OS control require orchestration or VMs.
Exam tip: Cloud Run fits stateless web services and jobs that respond to requests and then scale down, while GKE fits stateful and long-lived workloads that need persistent storage and Kubernetes-level control.
Evaluate Scalability, Performance, and Resource Optimization is the tradeoff between configuration flexibility and management effort across compute platforms. Cloud Run (opens in a new tab) scales container instances automatically on demand, Google Kubernetes Engine (GKE) (opens in a new tab) scales pods and nodes automatically inside a managed control plane, and Compute Engine (opens in a new tab) keeps VMs persistently available with manual or MIG-based scaling. The choice depends on whether the workload needs request-driven scale to zero, orchestrated container scaling, or steady throughput with full machine control.
Request-based scaling on Cloud Run services means capacity follows incoming requests without reserved servers. Google manages the OS, kernel, network setup, and capacity while you package the workload as a container. Traffic flows from incoming requests to container instances, and Cloud Run adds instances when requests or CPU consumption rise and removes instances when demand falls.
This lifecycle means an idle service can have zero running instances. A new request triggers Google to start an instance, the instance serves traffic, and the instance is removed after demand drops. That startup step can add latency for the first request compared to an already-running VM, but it avoids paying for idle servers during quiet periods. Choose Cloud Run when demand is variable or event-driven and fast scale-out with minimal operations matters more than always-on availability.
Persistent capacity on Compute Engine virtual machines means VMs stay running and available until you stop or delete them. You retain complete control over the OS, kernel settings, boot files, CPU, memory, storage types, and guest OS, but you also own network rules, traffic routes, and backup systems. This persistence provides predictable throughput for steady, stateful, or latency-sensitive workloads.
Scaling in Compute Engine is manual by default, with automatic options through MIGs. You can add or remove instances as needed, use custom tools, or configure MIGs to adjust capacity with demand, often combined with load balancing that distributes traffic between instances. Regional MIGs can provision VMs across multiple zones from the same instance template, so traffic continues to flow from the load balancer to healthy zones if one zone fails.
Machine and storage tuning for Compute Engine performance is how you optimize cost and speed by matching resources to the workload. Compute Engine offers general-purpose, compute-optimized, network-optimized, storage-optimized, memory-optimized, and accelerator-optimized machine families, plus custom machine types with tailored CPU and memory for some series. Region and zone selection also affects latency, cost, and availability, so place VMs near users or near dependent resources such as databases.
Storage choices change both performance and durability:
Choose Compute Engine when the application needs custom machine configurations, specialized kernel settings, fixed addresses, or persistent disks that survive restarts.
Pod and node autoscaling on GKE clusters separates container scaling from infrastructure scaling so each layer responds to a different signal. Google manages the Kubernetes control plane for security and availability, while containers run in pods scheduled onto worker nodes. GKE supports all available NVIDIA GPUs and Google TPUs for containerized workloads.
Pod capacity changes with application demand, and node capacity changes with demand for places to run pods:
The sequence preserves the dependency between pods and nodes. First, HPA creates pods that wait for free node resources, then the cluster autoscaler resizes the node pool so waiting pods can be scheduled, then pods flow onto new nodes and serve traffic. Only after a node is unneeded for an extended period and its pods can be scheduled elsewhere does the autoscaler delete the node. In Autopilot mode Google manages nodes and capacity, while in Standard mode you manage node pools.
Exam tip: Cloud Run scales automatically based on requests or CPU consumption, while Compute Engine requires you to add instances manually or configure MIGs for automatic resizing.
Scaling triggers and cost-efficiency comparison shows how scaling signals, ownership, and availability determine performance and cost:
| Platform | Scaling trigger | Capacity ownership | Availability pattern |
|---|---|---|---|
| Cloud Run | Incoming requests or CPU consumption | Google starts, runs, and scales instances | Scales out on demand and scales in when idle; supports NVIDIA RTX PRO 6000 Blackwell and L4 GPUs only |
| Google Kubernetes Engine (GKE) | Pod demand and node resource pressure | Google manages control plane; nodes are Google-managed in Autopilot or customer-managed in Standard | Pods and nodes persist and resize automatically; supports all NVIDIA GPUs and TPUs |
| Compute Engine | Manual action or MIG autoscaling policy | You manage instances, network rules, routes, and backups | VMs stay running for predictable throughput; supports all NVIDIA GPUs and TPUs |
Use request shape and state as the decision rule. Choose Cloud Run when traffic is spiky and containers can start on demand, choose GKE when many services need coordinated pod and node scaling, and choose Compute Engine when the workload needs persistent VMs or specific machine and storage tuning.
Container Standardization and Portability is the practice of packaging an application and its dependencies once and running the same image consistently across platforms. Google Kubernetes Engine (GKE) (opens in a new tab) and Cloud Run (opens in a new tab) both run containerized applications, while Compute Engine (opens in a new tab) runs VM instances where you manage the OS and software stack. Containers sit higher on the abstraction spectrum because Google manages more infrastructure and the developer focuses on the workload.
Containers as a consistent deployment unit isolate the application from differences in the host OS, so the same workload behaves the same way on a Kubernetes cluster and on a serverless platform. A containerized application bundles code with its dependencies for deploying and managing software consistently. By contrast, Compute Engine provides configurable VM and bare metal instances where you install and manage OS, networking, machine type, storage, and accelerators such as GPUs or TPUs.
Choose containers when you need consistency and movement between environments. Choose Compute Engine VMs when you need full customization of the OS and kernel. Portability comes from the image itself, not from recreating the underlying server in each environment.
Portable orchestration with GKE Kubernetes clusters uses an open-source, industry-standard orchestrator for deploying, scaling, and orchestrating containerized applications. Google manages the Kubernetes control plane for security and availability, while you deploy and manage container workloads. GKE builds on top of Compute Engine, so Compute Engine reliability practices still apply underneath the cluster.
GKE provides three related capabilities for portable, distributed workloads:
Because Kubernetes definitions for deployments, services, and scaling work the same way across clusters, workloads move more easily. A regional GKE cluster runs its control plane and nodes across multiple zones within a region, which increases availability compared to a zonal cluster. Multiple clusters can further increase flexibility and availability at the cost of increased complexity.
Serverless container operation on Cloud Run is a fully managed way to run highly scalable containerized applications without servers or clusters. Code packaged as a container flows from a deployment to the Cloud Run service, which then automatically scales instances up and down based on web requests, events, or CPU consumption. Google manages infrastructure, OS, and runtime environment, so no cluster capacity planning is required.
Cloud Run supports NVIDIA RTX PRO 6000 Blackwell and L4 GPUs and does not support TPUs. This makes Cloud Run suitable for request-driven APIs, web services, and event-driven microservices that scale to zero when idle and scale out rapidly under load. Choose Cloud Run when the workload fits a stateless container that responds to requests or events, and choose GKE when the workload needs long-running services, custom orchestration, multi-service networking, or full Kubernetes APIs.
Exam tip: Choose Cloud Run when you want serverless containers with automatic scaling based on requests, and choose GKE when you need Kubernetes orchestration with automatic pod and node scaling.
Portable compute options compared show how orchestration, OS control, and scaling determine abstraction and movement:
| Compute option | Orchestration | OS and kernel control | Scaling |
|---|---|---|---|
| Cloud Run | Serverless | Google managed | Automatic based on requests or CPU consumption |
| Google Kubernetes Engine (GKE) | Kubernetes | Google managed in Autopilot, semi-managed in Standard | Automatic pod and node scaling |
| Compute Engine | Manual | Self-managed | Manual or automatic by using managed instance groups |
Cloud Run maximizes abstraction because the service depends only on the container image and scales without cluster operations. GKE preserves portability through standard Kubernetes objects while giving more control over nodes, accelerators, and placement. Compute Engine gives granular control over OS and networking but requires manual setup, so workloads are less portable without additional automation.
Assess Application Architecture and Deployment Requirements means matching workload characteristics to the platform that fits its persistence, networking, and operational needs. Google Kubernetes Engine (GKE) (opens in a new tab) provides Kubernetes orchestration with granular cluster control, Cloud Run (opens in a new tab) provides serverless containers with automatic scaling and minimal management, and Compute Engine (opens in a new tab) provides self-managed VMs with full OS control. The choice depends on whether the workload is stateful or stateless, simple or complex, spiky or predictable, and how much control the team requires.
Platform control and management responsibility defines who manages infrastructure and how much the team can customize. GKE is a managed Kubernetes platform where Google manages the control plane for security and availability, while the team manages node configuration, networking, scaling, and upgrades. GKE offers full control over node configurations, network policies, security settings, and add-ons, with Autopilot mode where Google manages nodes and capacity and Standard mode where the team manages node pools.
Cloud Run runs containers directly on Google scalable infrastructure without clusters or servers to provision. The team provides source code or a container image and Cloud Run builds the container when needed, while Google handles OS, kernel, network setup, and capacity management. The team can configure environment variables, concurrency, and network connections but cannot customize underlying infrastructure. Compute Engine sits at the most-control end, where the team controls OS, kernel settings, boot files, CPU, memory, storage, and guest OS but must set up instances, network rules, routes, and backups or use MIGs.
Workload fit for stateful persistence and microservices depends on whether the application keeps state and how complex its orchestration is. GKE supports both stateless and stateful applications and is ideal for complex applications with specific resource needs. A stateful service that must persist data across restarts can attach persistent volumes in GKE for reliability, and a complex microservice can use Kubernetes to manage dependencies and fine-grained resource allocation and scaling.
Cloud Run is best suited for stateless, request-driven or event-driven services, including web services, APIs, functions, and batch jobs. A Cloud Run service scales container instances up and down based on incoming requests or CPU consumption, and a Cloud Run job runs background tasks and exits when done. Choose GKE when the workload needs stateful persistence, custom storage, custom network policies, or deep Kubernetes orchestration, and choose Cloud Run when the workload is stateless and benefits from no cluster management.
Pricing and scaling tradeoffs for traffic patterns determine cost efficiency under different loads. GKE scales pods with Horizontal and Vertical Pod Autoscalers and scales nodes with the cluster autoscaler, and its pricing model is pay-per-cluster per hour irrespective of mode, cluster size, or topology. Cloud Run scales automatically without manual intervention and its pricing model is pay-per-use rounded up to the nearest 100 milliseconds, so the team pays only when requests are served or jobs run.
| Platform | Management and control | Application fit | Pricing and scaling |
|---|---|---|---|
| GKE | Team manages clusters, nodes, networking, and upgrades; full customization of policies and add-ons | Stateless and stateful apps, complex microservices, custom infrastructure and networking | Pay-per-cluster per hour; automatic pod and node scaling |
| Cloud Run | No cluster management; configure environment, concurrency, and connections only | Stateless web services, APIs, event-driven services, batch jobs | Pay-per-use per 100 milliseconds; automatic scaling based on requests or CPU |
Spiky or idle-prone workloads such as product browsing, search, checkout, and periodic catalog updates cost less on Cloud Run because instances scale to zero between events and scale out during spikes. Steady and predictable workloads with consistent resource needs can cost less on GKE because the fixed per-cluster cost replaces per-request billing. Compute Engine scaling is manual or automatic with MIGs, which fits workloads needing custom machine types, specialized kernel settings, or low-latency placement near other resources.
Exam tip: Choose GKE when the workload needs persistent volumes or custom Kubernetes networking, and choose Cloud Run when the workload is stateless and benefits from scale-to-zero pay-per-use billing.
Hybrid and portable deployment across GKE and Cloud Run lets the same containerized workload move as requirements change. Both platforms use standard container images stored in Artifact Registry, so the same image runs on either platform without modification. Both use a declarative API model and YAML resources with the same standard structure, and the Cloud Run Admin API is designed to be compatible with Kubernetes concepts of Deployments, Services, and horizontal Pod autoscalers.
A hybrid architecture places each workload where it performs best while keeping unified operations. In an ecommerce example, the stateless frontend and batch jobs run on Cloud Run for automatic scaling, faster deployments, and pay-per-use efficiency, while product inventory runs on GKE for persistent storage and the recommendation engine runs on GKE for complex dependency control. Traffic flows from a Global external Application Load Balancer to services on both platforms, which enables gradual migration by shifting traffic. Requests flow from a Cloud Run service to a GKE cluster VPC network through Direct VPC egress, and the Kubernetes Service on the GKE side is exposed through an internal passthrough Network Load Balancer.
A hybrid approach is not always the best fit:
Use Compute Engine when the workload needs self-managed operating system and kernel control, custom networking, or manual software installation. Use Google Kubernetes Engine (GKE) when you need robust Kubernetes orchestration with automatic pod and node scaling for distributed applications or microservices. Use Cloud Run when you want fully managed serverless containers with minimal operational overhead and automatic scaling based on requests or CPU consumption.
In both modes Google manages the Kubernetes control plane for security and availability and manages the operating system. In Autopilot mode Google also manages cluster nodes and capacity adjustments without manual intervention. In Standard mode you manage node pools and can use Container-Optimized OS by default or Ubuntu as an option.
Cloud Run adds or removes container instances based on incoming requests or CPU consumption, can scale to zero when idle, and bills pay-per-use rounded up to the nearest 100 milliseconds. Google Kubernetes Engine (GKE) adjusts containers with the Horizontal and Vertical Pod Autoscalers and adjusts nodes with the cluster autoscaler, and bills pay-per-cluster per hour irrespective of mode, cluster size, or topology.
Cloud Run supports only NVIDIA RTX PRO 6000 Blackwell and L4 GPUs with no support for other GPU models or Google TPUs. Compute Engine and Google Kubernetes Engine (GKE) support all available NVIDIA GPUs and all available Google TPUs for their workloads.
Last updated