Prepare and test your skills

Prepare and test your skills

Core compute models in Google Cloud differ by level of abstraction, which is how much infrastructure Google manages versus how much you manage. Compute Engine (opens in a new tab) provides virtual machines with the most control, Google Kubernetes Engine (GKE) provides managed orchestration for containers, and Cloud Run provides a serverless platform with minimal management. Choosing a model means trading configuration flexibility for reduced management effort.
Virtual machines in Google Cloud are individual virtual servers provided by Compute Engine. You choose the machine type, image, zone, network, and operating system for each virtual machine. You remain responsible for patching, scaling, and operating those machines. This model fits lifting existing applications from an on-premises data center, running commercial software that needs operating system access, and running workloads that need a specific machine type or low-latency connection to resources in the same zone.
Containers are lightweight packages that hold an application and everything it needs to run, so the same container runs consistently in different environments. Google Kubernetes Engine (GKE) is Google Cloud's managed Kubernetes service for deploying and operating containerized applications at scale. GKE automates deploying, scaling, and managing containers running in clusters, but you still package workloads as containers and define how they should be orchestrated. Choose containers on GKE when you want more configuration flexibility than serverless plus automated orchestration for many containers.
Microservices are an application design where a large application is split into small, independent services that communicate with each other. A common example is separate APIs for users, orders, and payments. In Google Cloud, microservices are typically deployed as standard containerized applications that run in containers. GKE is the recommended option for standard containerized microservices or APIs when cluster orchestration is needed. Each service can then be updated, scaled, and restarted independently instead of redeploying the whole application.
Serverless computing lets you focus on data and applications instead of setting up and operating infrastructure resources. Cloud Run is a serverless platform that runs containerized web applications, asynchronous tasks, or batch jobs without server or cluster management. Google handles the operating system, kernel, network setup, and capacity management. For web services, Cloud Run automatically adds or removes container instances based on incoming requests or CPU consumption. Choose Cloud Run when you want to deploy code or containers to a preconfigured platform with minimal management effort.
The three models form a spectrum from maximum control to minimum management. Virtual machines and containers give more configuration flexibility but require you to manage resources, while serverless deploys workloads to a preconfigured platform that needs minimal management.
A decision tree branching on desire for minimal management and need for container orchestration to choose between Cloud Run, GKE, and Compute Engine.
| Model | Google Cloud example | Infrastructure management | Choose when |
|---|---|---|---|
| Virtual machines | Compute Engine | You manage virtual machines, operating system, and scaling | You need full control, custom images, specific machine types, or operating system access |
| Containers | Google Kubernetes Engine (GKE) | You package containers; Google provides managed Kubernetes orchestration | You run standard containerized applications such as microservices or APIs that need orchestration |
| Serverless | Cloud Run | Google manages servers, operating system, network, and scaling | You want to deploy containerized apps or jobs without server or cluster administration |
Exam tip: Choose virtual machines or containers for more configuration flexibility with more management responsibility, and choose serverless on Cloud Run for minimal management on a preconfigured platform.
Containerization and orchestration in Google Cloud is the practice of packaging applications into portable containers and automatically managing those containers at scale. Kubernetes provides the open-source orchestration system, and Google Kubernetes Engine (GKE) (opens in a new tab) provides the managed Google Cloud service that runs Kubernetes clusters so teams do not manage each container by hand.
Containerization bundles an application together with its dependencies into a standard container image, such as a Docker image, so the workload runs the same way on different platforms. Because everything the app needs travels with it, teams avoid problems caused by differences in the underlying system. Containers are also typically small, so they deploy quickly, reliably, and automatically from definitions and images compared with virtual machines.
Containerization supports modern application design in three related ways:
Google Cloud extends this model with image storage and workload mobility. Artifact Registry provides private storage for Docker images through an HTTPS endpoint, so images can be pulled from Compute Engine instances or other machines. The service hosts custom images in Cloud Storage under a Google Cloud project, and by default those images are only accessible by principals that have access to the project. Mobility means workloads can be moved and combined across other cloud providers or mixed with on-premises systems to create a hybrid solution.
Google Kubernetes Engine (GKE) is the managed service built on Kubernetes, the open-source container-orchestration system introduced by Google. A GKE environment consists of nodes, which are Compute Engine virtual machines (VMs), grouped together to form a cluster. Workloads are packaged into containers and deployed as Pods onto those nodes, and operators use the Kubernetes API to administer, scale, and monitor the workloads.
GKE removes much of the manual work of running containers. Instead of creating and shutting down each container by hand, GKE automatically manages the cluster using the configuration the operator defines. Kubernetes clusters also have management nodes called the control plane, which run system components such as the Kubernetes API server. In GKE, Google Cloud manages the control plane and system components, while users deploy and manage their container workloads.
A Pod in GKE is an app-specific logical host for one or more containers that runs on a node instance. Containers in the same Pod can share several resources, including a set of shared storage volumes. A single container and volume can also use a Pod, but the Pod is the required abstraction that logically connects containers and resources to each other.
Pods and volumes matter because on-disk files inside a container are ephemeral. When a container restarts after a crash, its on-disk files are lost, which is different from a normal Compute Engine instance where the attached disk volume remains with the instance. Kubernetes solves this loss with volume and Storage Class abstractions, including the GCE PD storage class. That class lets containers use Compute Engine persistent disks, so data files are not deleted during restarts and can be shared among containers within the Pod.
Load balancing in GKE distributes incoming traffic across multiple containers, nodes, and Pods so large web architectures can share traffic demand. Traffic flows from internet clients to the load balancer, and the load balancer forwards the traffic to the available GKE endpoints. GKE supports two main approaches that differ in simplicity, protocol support, and routing intelligence.
Internet clients split to Network Load Balancing via Service type LoadBalancer for TCP/UDP and to HTTP(S) Load Balancing via Ingress for content-based routing, both distributing traffic to Nodes and Pods in a GKE cluster.
| Option | How it is enabled | What it routes on |
|---|---|---|
| Network load balancing | Add type: LoadBalancer to the service configuration file, which uses Compute Engine network load balancing with forwarding rules that point to target pools listing available instances | Incoming internet protocol data such as address, port, and protocol type, including additional TCP/UDP protocols such as SMTP traffic, while the app can directly inspect packets |
| HTTP(S) load balancing | Create a Kubernetes Ingress resource, which provisions and configures the Compute Engine HTTP/HTTPS load balancer from a collection of rules for routing external traffic to Kubernetes endpoints | Advanced HTTP behavior such as HTTPS, content-based routing, and cross-region routing |
Choose network load balancing when the need is simple TCP/UDP distribution and direct packet inspection. Choose the Ingress-based HTTP(S) approach when the need requires HTTPS handling, routing by content, or distributing traffic across regions.
Exam tip: type: LoadBalancer creates network load balancing for TCP/UDP traffic, while an Ingress resource provisions HTTP/HTTPS load balancing for content-based and cross-region routing.
The Cluster Autoscaler in GKE automatically resizes clusters so applications perform well under peak load without keeping unneeded capacity during typical demand. The autoscaler periodically checks for Pods that are waiting for a node with free resources but are not being scheduled. If such waiting Pods exist and resizing the node pool would allow them to be scheduled, the autoscaler grows the node pool.
The Cluster Autoscaler also shrinks the cluster to control cost and maintain efficiency. It monitors the usage of all nodes, and if a node is not needed for an extended period and all of its Pods can be scheduled elsewhere, the node is deleted. Together, growing for unscheduled Pods and removing long-idle nodes keeps containerized applications available, responsive, and cost-efficient as demand changes.
Resource efficiency in Google Cloud means matching compute capacity to actual demand so applications stay responsive without paying for idle resources. Managed autoscaling adds or removes capacity as load changes, while discounted pricing options lower the cost of the capacity that is used. Together with right-sizing and cost tracking, these mechanisms support resilient and economical cloud compute strategies.
Managed autoscaling is the automatic adjustment of compute capacity based on workload fluctuations to maintain performance while avoiding over-provisioning. When demand rises, the platform adds resources to handle the load, and when demand falls, the platform removes resources to reduce costs. This balance improves performance, saves money, and makes use of cloud resources more efficient.
Three Google Cloud autoscaling options cover different compute models:
| Option | What it scales | How scaling is triggered |
|---|---|---|
| Compute Engine managed instance groups (MIGs) | Group of virtual machines (VMs) managed as a single entity | Autoscaling policy with minimum and maximum VM counts and thresholds such as CPU utilization |
| Google Kubernetes Engine (GKE) autoscaling | Cluster nodes and container Pods | Pod and node resource demands, CPU, memory, or custom metrics |
| Cloud Run | Serverless container instances | Incoming request traffic with built-in scale up and scale down |
Compute Engine managed instance groups (MIGs) treat a group of VMs as one unit that scales together. An autoscaling policy defines the minimum and maximum number of VMs to maintain and the conditions that trigger a change. For example, the policy can add VMs when CPU utilization reaches a high threshold and remove VMs when utilization drops below a low threshold.
Google Kubernetes Engine (GKE) autoscaling adjusts both cluster infrastructure and application replicas to match application needs. Its tools work together to optimize utilization, protect performance, and simplify management:
Cloud Run is a serverless platform that runs containerized code without managing servers or clusters. Traffic flows from incoming requests to container instances, and Cloud Run adds instances when traffic increases and removes instances when traffic decreases. Because capacity follows traffic automatically, applications can handle varying workloads without manual sizing or paying for idle servers.
Cost optimization is the practice of choosing pricing models and capacity types that deliver the best value for a workload. Google Cloud offers discounts for steady or committed use and lower prices for flexible use of spare capacity. Reviewing pricing models regularly helps teams choose more cost-effective instance types as features and prices change.
Google Cloud cost-optimization options include:
Exam tip: Spot VMs cost less than regular VMs because they use unused capacity, while committed use discounts cost less in exchange for a usage commitment over time.
Right-sizing is the continuous process of monitoring resource use and adjusting allocation to match actual demand. Over-provisioning leads to unnecessary cost, while under-provisioning causes performance bottlenecks that affect applications and users. A proactive approach uses real usage data to keep cost and response time in balance.
Cloud Monitoring (opens in a new tab) provides real-time visibility into resource utilization metrics so usage patterns and inefficiencies can be tracked. Recommender analyzes that utilization data and suggests ways to optimize allocation, such as changing machine types. Custom metrics and alerts can also notify administrators when thresholds are met, so allocation can be adjusted before performance suffers or costs grow.
Tracking spending by resource makes savings visible and repeatable. Tags and labels categorize resources by project, department, or other dimensions, so teams can monitor spending patterns and find high usage or potential savings. Cloud Billing and Cost Management tools provide budgets, alerts, dashboards, and reports that show trends, forecast costs, and identify focus areas for further optimization.
GCE PD storage class lets containers use Compute Engine persistent disks so data survives container restarts.type: LoadBalancer enables network load balancing for TCP/UDP and an Ingress resource provisions HTTP(S) load balancing for content-based and cross-region routing.Use Compute Engine virtual machines (VMs) when you need full control, custom images, specific machine types, or operating system access, use Google Kubernetes Engine (GKE) for standard containerized applications such as microservices or APIs that need orchestration, and use Cloud Run when you want to deploy containerized apps or jobs without server or cluster administration. Virtual machines (VMs) and containers give more configuration flexibility but require you to manage resources, while serverless deploys workloads to a preconfigured platform with minimal management.
Kubernetes is the open-source container-orchestration system for automatically managing containers at scale, and Google Kubernetes Engine (GKE) is the managed Google Cloud service that runs Kubernetes clusters. A Google Kubernetes Engine (GKE) environment consists of nodes, which are Compute Engine virtual machines (VMs), grouped together to form a cluster where workloads are packaged into containers and deployed as Pods, while Google Cloud manages the control plane and system components.
Network load balancing is enabled by adding type LoadBalancer to the service configuration and routes incoming internet protocol data such as address, port, and protocol type including TCP and UDP protocols, while HTTP(S) load balancing is provisioned by creating a Kubernetes Ingress resource and routes on advanced HTTP behavior such as HTTPS, content-based routing, and cross-region routing. Choose network load balancing for simple TCP and UDP distribution with direct packet inspection and choose Ingress-based HTTP(S) load balancing when HTTPS handling, routing by content, or distributing traffic across regions is needed.
Spot virtual machines (VMs) provide access to unused virtual machine capacity at a lower cost compared to regular virtual machines (VMs), while committed use discounts provide discounts for committing to a certain level of usage over a period of time.
An enterprise is modernizing a monolithic web application by decomposing it into microservices packaged inside containers to ensure consistency across development and production environments. The operations team requires a fully managed platform in Google Cloud that can automate container scheduling, dynamically scale cluster resources with traffic fluctuations, and balance traffic across application instances.
Which Google Cloud service should the enterprise implement?
Last updated