Prepare and test your skills

Prepare and test your skills

Containerized deployment and orchestration models on Google Cloud center on two platforms that run standard container images in different ways. Google Kubernetes Engine (GKE) (opens in a new tab) provides full Kubernetes orchestration for complex, multi-container workloads, while Cloud Run (opens in a new tab) provides serverless execution without clusters to manage. The choice balances infrastructure control, automatic scaling, and management overhead.
Google Kubernetes Engine for orchestrated containers is a managed Kubernetes platform for deploying, scaling, and orchestrating containerized applications. GKE supports both stateless and stateful applications and fits complex microservices with dependencies and specific resource needs. For stateful services, GKE attaches persistent volumes so data survives container restarts.
Responsibility for GKE is split between Google and the user. Google manages the Kubernetes control plane for security and availability, while the user handles cluster aspects such as node configuration, networking, scaling, and upgrades. In Autopilot mode Google provisions and scales nodes automatically and the user pays only for resources requested by workloads, while in Standard mode the user manages node pools directly. Capacity adjusts with Horizontal and Vertical Pod Autoscalers, which add or remove containers, and the cluster autoscaler, which adds or removes nodes. Pricing is pay-per-cluster per hour, regardless of mode, size, or topology.
Cloud Run for serverless containers is a fully managed platform that runs containers directly on Google's scalable infrastructure. Cloud Run covers two models: Cloud Run services for code that responds to web requests, and Cloud Run jobs for code that performs background tasks and then exits. A request flows from the client to the Cloud Run service, Google starts a container instance to handle it, and the instance scales down when traffic stops.
With Cloud Run the user provides only source code or a container image, and Google manages the operating system, kernel, network setup, and capacity. Cloud Run supports deploying from three sources:
When building from source, the steps of building and deploying the container image are automatic with no custom configuration. For web services, Cloud Run adds or removes instances based on incoming requests or CPU use, with no manual intervention. Pricing is pay-per-use rounded up to the nearest 100 milliseconds, so cost follows actual use.
Choosing between GKE and Cloud Run depends on application type, control needs, and cost pattern. GKE fits when deep Kubernetes control, custom networking, persistent storage, or complex orchestration is required, while Cloud Run fits when simplicity, automatic request-driven scaling, and minimal operations are required.
A decision tree that branches first on needing full OS or kernel control plus any GPU or TPU (Compute Engine), then on Kubernetes orchestration, stateful or persistent-volume needs (GKE), and finally on stateless request-driven, event-driven, or batch work (Cloud Run).
| Feature | GKE | Cloud Run |
|---|---|---|
| Deployment and management | User manages clusters, including nodes, networking, scaling, and upgrades | No cluster to manage; provide source or image and Google builds and runs it |
| Control and flexibility | Full control over node configuration, network policies, security, and add-ons | Limited infrastructure control; configure environment variables, concurrency, and connections |
| Application types | Stateless and stateful apps with specific resource needs | Stateless, request-driven services, APIs, and batch jobs |
| Pricing model | Pay-per-cluster per hour | Pay-per-use, rounded up to nearest 100 milliseconds |
Both platforms use the same standard container images stored in Artifact Registry, so the same image can run on either platform without modification. Both integrate with Cloud Logging, Cloud Monitoring, load balancing, Virtual Private Cloud (VPC) networking, and Cloud Deploy for delivery. A global external Application Load Balancer can sit in front of services on both runtimes, so traffic can shift gradually from GKE to Cloud Run or split across both during migration.
Exam tip: Choose GKE for stateful services needing persistent volumes and Kubernetes control; choose Cloud Run for stateless, request-driven services needing automatic scaling and pay-per-use billing.
Infrastructure control and customization requirements form a spectrum from raw virtual machines to fully managed platforms. Compute means the virtualized processing power and memory needed to run applications. With virtual machine (VM) instances you customize the operating system, networking, and software stack, while with managed platforms Google handles most of the underlying infrastructure.
Infrastructure as a Service (IaaS) is the cloud model that offers the most control over the environment. In IaaS, you manage the operating system (OS), middleware, and applications, while Google manages virtualization, servers, storage, and networking. This split is preferred by architects and platform engineers who need to design custom environments from scratch. Choose IaaS when the workload cannot run correctly without direct access to the OS and system configuration.
Compute Engine (opens in a new tab) is the IaaS service for creating and running VM and bare metal instances on Google infrastructure. Compute Engine lets you choose the machine series, storage, accelerators, and guest OS for each instance. You keep self-managed control over the OS and kernel, including custom kernel configurations, and you can attach specialized hardware.
Compute Engine is the optimal choice when a workload needs full OS access, custom system settings, or specialized hardware that managed platforms do not allow. This need is common for legacy applications that depend on a specific OS version or kernel module and for high performance computing (HPC) workloads such as tightly coupled physics simulations, weather models, or molecular dynamics. Choose Compute Engine when you see these signals:
The tradeoff for this flexibility is operational responsibility, because you patch the OS, configure scaling, and manage availability. Scaling is manual by default or automatic by using managed instance groups (MIGs).
Control and accelerator comparison across compute options shows who manages the OS and which accelerators each option allows. Google Kubernetes Engine (GKE) (opens in a new tab) supports the same broad accelerator choice as Compute Engine but Google manages the OS and Kubernetes control plane. Cloud Run and Batch are Google-managed for the OS and offer only limited or no accelerator options, while Google Cloud VMware Engine preserves VM and guest OS control for VMware migrations but offers no GPU or TPU support.
| Compute option | OS and kernel control | GPUs | TPUs |
|---|---|---|---|
| Compute Engine | Self-managed | All available NVIDIA GPUs | All available Google TPUs |
| Google Kubernetes Engine (GKE) | Google-managed in Autopilot or semi-managed in Standard | All available NVIDIA GPUs | All available Google TPUs |
| Cloud Run | Google-managed | NVIDIA RTX PRO 6000 Blackwell and L4 only | No |
| Google Cloud VMware Engine | You control VMs and guest OS; Google manages hardware and VMware platform | No | No |
Because Compute Engine keeps OS control with you, data and configuration flow from your custom image and machine definition directly to the VM without passing through a Google-managed runtime constraint. GKE adds a Kubernetes orchestration layer between you and the nodes, and Cloud Run removes server and cluster management entirely in exchange for less customization.
Exam tip: Choose Compute Engine when the workload needs self-managed OS and kernel plus any NVIDIA GPU or Google TPU; choose a Google-managed option when you can accept a Google-managed OS to reduce operational work.
Event-driven and serverless execution scenarios describe code that runs only in response to a request or event with no servers to manage. Cloud Run (opens in a new tab) is the fully managed serverless platform for this model. Google starts, scales, and stops container instances automatically, and billing is pay-per-use rounded up to the nearest 100 milliseconds, including scale to zero when there is no traffic.
Cloud Run as a serverless execution environment runs containerized applications directly on Google's scalable infrastructure. You provide source code or a container image, and Cloud Run builds the container when needed without requiring you to create a cluster or provision infrastructure. Google handles all infrastructure management for Cloud Run, including the operating system, kernel, network setup, and capacity management.
Cloud Run adds or removes container instances without manual intervention based on incoming requests or CPU consumption. This instant autoscaling lets stateless services handle traffic spikes and large batch work without tuning scaling rules. Because instances scale to zero when idle, you pay only when requests are served or when resources are used during job execution.
Cloud Run functions (opens in a new tab) are lightweight, single-purpose functions hosted by Cloud Run for event-driven execution. A Cloud Run function stays idle until an event or request invokes it, then Cloud Run provisions compute, runs the code, and scales automatically as event volume grows. This model lets developers focus on code while Cloud Run handles building, deploying, and scaling.
Cloud Run functions fit stateless work that starts quickly and finishes without keeping local state:
In the ecommerce example, Cloud Run functions can initiate batch jobs on Cloud Run to create seamless workflows. The flow runs from the event source to the function, then from the function to downstream Cloud Run work, with the platform scaling each step independently.
Cloud Run services and jobs are the two deployment models that cover most serverless application shapes. Cloud Run services are for code that responds to web requests and stays available to serve traffic. Cloud Run jobs are for code that performs one or more background tasks and then exits when the work is done.
Cloud Run supports three code sources across both models: individual lightweight functions, full applications built from source code, and prebuilt containerized applications. The build-and-deploy capability automatically builds the application container image that will be executed, so no custom build configuration is required. Together, services and jobs let one serverless platform handle both continuous request serving and finite run-to-completion work.
Portable serverless with Kubernetes standards lets the same container move between serverless and Kubernetes runtimes. Knative serving (opens in a new tab) provides the standardized, portable foundation for serverless workloads in the Kubernetes ecosystem, and Cloud Run follows that same declarative, container-based model. Both GKE and Cloud Run use standard container images stored in Artifact Registry, so the same image can run on either platform without modification.
The Cloud Run Admin API v1 is designed to be compatible with the Kubernetes API, so familiar concepts such as Deployments, Services, and horizontal Pod autoscalers translate to Cloud Run services. This compatibility makes it straightforward to move a workload from Cloud Run to GKE when it needs persistent storage or deeper control, and to package a Kubernetes deployment into a Cloud Run-compatible container when it fits serverless. Portability also extends to operations, because both runtimes integrate with Cloud Logging, Cloud Monitoring, Binary Authorization, and Cloud Deploy for consistent observability, policy enforcement, and delivery.
Exam tip: Choose Cloud Run when the workload is stateless and event-driven with variable traffic; choose GKE when the workload is stateful or needs custom nodes, storage volumes, and Kubernetes-level control.
Use Google Kubernetes Engine (GKE) instead of Cloud Run when you need full Kubernetes orchestration, custom networking, persistent volumes for stateful applications, or control over node configuration, scaling, and upgrades. Choose Cloud Run when you need serverless execution with no cluster to manage, automatic request-driven scaling to zero, and pay-per-use billing rounded up to the nearest 100 milliseconds.
Cloud Run services are for code that responds to web requests and stays available to serve traffic, while Cloud Run jobs are for code that performs background tasks and then exits when the work is done. Both models support individual lightweight functions, full applications built from source code, and prebuilt containerized applications, with automatic building of the container image and automatic scaling without manual intervention.
Use Compute Engine when the workload needs full administrator access to install and manage its own operating system, drivers, and middleware, a custom kernel, custom networking setup, or bare metal isolation, or free choice of accelerators including all available NVIDIA GPUs and Google TPUs. Google Kubernetes Engine (GKE) and Cloud Run use a Google-managed operating system to reduce operational work but allow less customization, with Cloud Run limited to NVIDIA RTX PRO 6000 Blackwell and L4 GPUs and no TPU support.
Cloud Run functions are lightweight, single-purpose functions hosted by Cloud Run that stay idle until an event or request invokes them, then Cloud Run provisions compute, runs the code, and scales automatically as event volume grows. They fit stateless work that starts quickly and finishes without keeping local state, such as stateless web services and APIs that respond to HTTP requests, frontend website and mobile app backends, periodic batch processing jobs, and event-driven workflows that initiate work on Cloud Run.
A startup is deploying a new containerized REST API that serves mobile application clients. The architecture and operational requirements include:
Which Google Cloud compute service should the team select?
Last updated