Prepare and test your skills
Prepare and test your skills
Workload portability and hybrid-cloud architecture is the ability to run and shift applications across on-premises data centers, edge locations, Google Cloud, and other clouds without rewriting the application. Portability depends on a common runtime layer that hides infrastructure differences, plus consistent deployment, security, and management in every environment. Kubernetes (opens in a new tab) and Google Kubernetes Engine (GKE) provide that common layer and reduce vendor lock-in while still allowing cloud-first design.
A portable workload is an application that moves from one computing environment to another without major changes to its code or to how it is deployed and managed. Portability requires consistent deployment, configuration, visibility, and security across environments so operations work the same way everywhere. Portable design does not prevent cloud-first design, so teams can still use managed services and modern architectures while keeping the option to move.
Containers and Kubernetes create a common runtime layer that abstracts away differences between edge, on-premises, and cloud infrastructure. Containers decouple applications from the underlying host, so software runs reliably when it moves between environments. Kubernetes handles orchestration, deployment, scaling, and management of those containerized applications and is open source governed by the Cloud Native Computing Foundation (CNCF).
Kubernetes supports portability across hybrid and multicloud environments because:
Using only VMs as the common foundation makes true cloud-first applications harder to build and can block use of cloud-managed services. A custom toolchain built from Terraform, Ansible, Puppet, Chef, Packer with Cloud Build, Prometheus, and Grafana can unify provisioning and monitoring, but it adds overhead, operational cost, and training complexity.
Google Kubernetes Engine (GKE) (opens in a new tab) is the managed Kubernetes platform for running modern applications at scale on Google Cloud, on-premises, at the edge, and in other clouds. When a workload runs on Google Cloud, GKE removes the work of installing and operating Kubernetes so operations staff can focus on applications rather than infrastructure. GKE Autopilot is a GKE mode that manages cluster configuration including nodes, scaling, and security with preconfigured settings and per-cluster scaling limits.
For multicluster use, GKE lets teams operate clusters as fleets. A fleet is a logical grouping of similar Kubernetes clusters with consistent security, configuration, and service management. GKE includes managed open source components to secure workloads, enforce compliance policies, and provide network observability and troubleshooting. Google Distributed Cloud extends this model to on-premises and edge locations, including connected configurations where a GKE cluster on-premises or at the edge connects to Google Cloud.
| Option | When to use it | What it provides |
|---|---|---|
| GKE hybrid environment | Build cloud-like experiences on-premises or transition applications toward Google Cloud | Unified solution for running and migrating workloads between on-premises and Google Cloud |
| GKE Multi-Cloud | Run and govern clusters across multiple public clouds | Consistent governance, operations, and security posture across clouds |
GKE also supports a zero trust distributed architecture. In that architecture, services deployed on-premises or in another cloud communicate across environment boundaries through end-to-end mutual Transport Layer Security (mTLS) for secure service-to-service communication.
Exam tip: A portable application moves with minimal changes, but it does not automatically perform equally well in both environments because compute, security, networking, and proximity to dependencies still differ.
Kubernetes and GKE hide many environment differences, but three portability limits still affect design. Performance can differ because underlying compute, infrastructure security, networking, and proximity to dependent services vary between environments. Moving a workload can require moving data because environments have different storage and management services. Load balancer behavior and performance provisioned through Kubernetes or GKE can also differ between environments.
Data movement planning therefore shapes portability. Teams need to identify business use cases and the data that powers them, plus storage type, capacity, accessibility, and movement options. Google Cloud data movement options help move, integrate, and transform data across environments, while Sensitive Data Protection helps discover, classify, and protect data assets where regulated data has storage-location or cross-region movement restrictions.
Consistent operations keep portable workloads movable in practice, not only in principle. A centralized management plane and monitoring solution in the cloud manages multiple on-premises, edge, and cloud clusters efficiently. Continuous integration and continuous delivery (CI/CD) pipelines and deployment, configuration, and monitoring tooling stay consistent across environments, and the exact same binaries, packages, or containers deploy everywhere, for example with Tekton pipelines that deploy to clusters across environments.
Cross-environment traffic needs common controls because protocols, APIs, and authentication differ. Common identity lets systems authenticate securely across environment boundaries, and all sensitive communication is encrypted in transit using virtual private network (VPN) tunnels, Transport Layer Security (TLS), or both. Apigee (opens in a new tab) and Apigee Hybrid act as a unifying facade and centralized control point that adds security, shields clients from backend changes, supports audit trails, and bridges legacy and modernized services.
Resource optimization and provisioning models match Google Cloud capacity to actual demand so performance stays strong without paying for idle resources. The practice combines right-sizing existing resources, automatically scaling capacity up and down, and choosing the provisioning model that gives the lowest price for each workload's stability needs. Together these practices let an architecture stay flexible as project needs change while keeping cost and functionality in balance.
Right-sizing means continuously monitoring utilization and adjusting allocation to match real demand. Over-provisioning creates unnecessary cost, while under-provisioning creates performance bottlenecks that affect application performance and user experience. A proactive approach avoids both extremes by scaling resources in a timely manner.
Cloud Monitoring (opens in a new tab) provides real-time visibility into utilization metrics such as CPU, memory, network traffic, and disk I/O, which lets teams track usage patterns and spot inefficiencies. Recommender analyzes that utilization data to suggest more efficient allocations, including more cost-effective machine types. Teams can also use custom metrics tied to application behavior and configure alerts that notify administrators when thresholds are met, so administrators can adjust allocation before performance suffers.
Autoscaling dynamically adjusts capacity based on workload fluctuations, so applications have resources when needed and release them when load drops. When load increases, autoscaling provisions additional resources automatically to protect availability, and during low load it removes unused resources to reduce cost. This removes the operational overhead of manually adding and removing redundant capacity.
Google Cloud provides different autoscaling mechanisms for different compute shapes:
Choosing the compute platform itself is a flexibility tradeoff. VMs and containers provide more configuration flexibility but require the team to manage the resources, while a serverless platform like Cloud Run runs on a preconfigured platform with minimal management effort.
VM machine type selection controls how closely Compute Engine capacity fits a workload's compute requirements. Compute Engine provides machine type recommendations that analyze usage and suggest types that match the workload, helping to remove underutilized resources. For workloads with predictable resource requirements, custom machine types let teams define a size tailored to their needs and save money compared to running a larger predefined type.
Right-sizing machine types works best when combined with autoscaling and periodic reassessment. After deployment, teams should monitor utilization, benchmark resource efficiency under both normal and peak load, and repeat the review as application behavior, user load, and reliability objectives change. This cycle prevents a choice that was efficient at launch from becoming over-provisioned later.
Provisioning models reduce the billing rate in exchange for different levels of commitment or tolerance for interruption. Committed use discounts (CUDs) reward a one-year or three-year commitment, sustained use discounts reward consistent Compute Engine usage automatically, and Spot VMs provide access to unused VM capacity at a lower price without a commitment. Pricing models change over time, so teams should regularly review pricing and consider alternative features that offer better performance or lower cost.
| Provisioning option | Commitment | Discount scope | Choose when |
|---|---|---|---|
| Spot VMs | No commitment; Compute Engine can preemptively stop or delete VMs to reclaim capacity | Per VM, more than 80% cheaper than regular VMs | The workload is fault-tolerant and flexible, such as batch jobs that tolerate preemption and do not require high availability |
| Resource-based CUDs | Commit to a minimum quantity of Compute Engine resources for one year or three years | Specific region, with sharing across projects in most Cloud Billing accounts | Usage is stable and regionally predictable, so the committed quantity will be consumed |
| Spend-based CUDs | Commit to spend a minimum amount on a particular product for one year or three years | Billing account level, applied regionally or globally depending on the product | Spending is predictable at the product level but needs regional or global flexibility |
Enterprise discounts are separate negotiated discounts based on a minimum total Google Cloud spend at a reduced rate, and CUDs can deliver additional savings on top of enterprise discounts. For assured availability rather than discount, reservations provide guaranteed capacity in a specific zone for a chosen number of VMs of a machine type, and a reservation can be specific to a project or shared across multiple projects.
Exam tip: Choose Spot VMs for interruptible, fault-tolerant work that can be stopped, and choose CUDs for stable, long-running usage that will consume a one-year or three-year commitment.
Tracking usage preserves the flexibility to pivot infrastructure because cost and utilization data show where to cut, resize, or recommit. Tagging and labeling resources by dimensions such as project or department lets teams categorize spending, monitor patterns for specific resources, and identify high usage or savings opportunities. Cloud Billing (opens in a new tab) and Cost Management provide detailed usage insights, trend analysis, and forecasting, while budgets and alerts notify teams when spending exceeds a set budget.
Custom dashboards and reports extend that visibility by tracking key performance indicators and filtering cost data by time period or resource type. Region choice should be revisited in the same review cycle, weighing resource cost and cross-regional transfer cost against latency, service and machine-type availability, regulatory needs, and sustainability. The Google Cloud Region Picker helps compare those cost, sustainability, and latency tradeoffs, so a move to a cheaper region does not unintentionally harm performance or compliance.
Elastic scaling is the ability of a cloud architecture to add and remove capacity automatically as demand rises and falls. In Google Cloud, Managed Instance Groups (MIGs) provide horizontal scaling for virtual machines (VMs), Cloud Load Balancing spreads traffic across that capacity, and Cloud Monitoring supplies the performance signals that trigger scaling. Managed services reduce operational work because high availability, redundancy, and scaling controls are built into the platform.
Managed Instance Groups (MIGs) (opens in a new tab) are homogeneous groups of Compute Engine VMs that operate as a single scalable unit. When load increases, the autoscaler adds VMs to the MIG, and when load decreases, the autoscaler removes VMs, so the application consumes only the resources needed to meet demand. A regional MIG distributes VMs across multiple zones in a region, which keeps capacity available if one zone is disrupted, while a zonal MIG keeps all VMs in one zone.
MIGs combine scaling with self-repair. Autoscaling adjusts the number of VMs up or down based on signals such as processor use or traffic, while autohealing uses health checks to detect unhealthy VMs and automatically recreates them. Because the load balancer sends traffic only to healthy VMs in the group, a failed VM does not receive user requests while its replacement is created. Choose horizontal scaling with MIGs when workloads can run on multiple identical VMs and need to survive VM or zone failures.
Automated scaling in Compute Engine adjusts MIG size in response to real-time traffic patterns and performance metrics. The autoscaler watches a configured signal, compares it to a target, and adds or removes VMs to hold performance steady during peaks and save cost during dips. Cloud Monitoring feeds this loop by ingesting events, metrics, and metadata from Google Cloud services and exposing them through dashboards and alerts.
The documentation supports four autoscaling signals for a MIG. Infrastructure metrics such as processor load and memory use show whether machines are overloaded, application-level metrics capture custom behavior such as query time, and load-balancing signals show whether serving capacity is exhausted.
| Autoscaling signal | What the autoscaler watches | Choose when |
|---|---|---|
| CPU utilization | Average processor use across VMs in the MIG | Demand correlates closely with processor load |
| Cloud Monitoring metrics | Standard or custom metrics, such as requests, latency, or queue depth | Processor use alone does not reflect user experience |
| Load-balancing serving capacity | Utilization or requests per second defined in the load balancer backend service | VMs sit behind a load balancer and become over or under capacity |
| Schedules | Time of day, day of week, or known events | Load follows a predictable calendar, such as business hours or seasonal peaks |
Cloud Load Balancing (opens in a new tab) is a managed, redundant service that distributes incoming traffic across multiple VM instances so no single instance is overloaded. Traffic flows from clients to a forwarding rule, from the forwarding rule to the load balancer, and from the load balancer to healthy VMs in the backend MIGs. Each forwarding rule defines an entry point, such as an external IP address and port, and matches traffic types before forwarding them.
Health checking connects load balancing to elasticity. A health check defines how the load balancer probes VMs to decide which instances should continue to receive traffic, and unhealthy instances are automatically removed from rotation until they recover. For regional resilience, an application can run on regional MIGs in multiple zones behind one regional entry point, so traffic spreads across all zones in the region. For multi-region resilience, global HTTP(S) load balancing lets traffic enter Google Cloud nearest the client and automatically diverts traffic to another region if one region becomes unreachable, while keeping the same external IP address.
Exam tip: Scale a MIG on load-balancing serving capacity when the backend service defines capacity as utilization or requests per second; scale on CPU utilization when processor load is the scaling target.
Capacity planning ensures that elastic infrastructure has enough headroom, limits, and reserved capacity to scale when needed. Forecasting starts with user counts, request rates, historical trends, seasonal variation, special-event spikes, and growth from new geographies. Estimates then translate that forecast into concrete resources, such as MIG size, VM machine type, and the number, type, and size of persistent disks.
Reliable plans include redundancy, efficiency testing, quota control, and ongoing review:
Managed services provide built-in high availability, backup, and scalability backed by service agreements, so teams do not build those controls themselves. For compute, Compute Engine MIGs and Google Kubernetes Engine (GKE) clusters provide elastic hosting, and regional MIGs and regional GKE clusters are resilient to zone outages. For data, managed services such as Cloud SQL (opens in a new tab), Cloud Storage, and Spanner provide synchronous replication within a region or multi-region configurations for wider resilience. For traffic, Cloud Load Balancing is itself redundant and highly available, so a load-balancing component that fails is restarted or replaced automatically.
Fast scale-out also depends on fast startup. Pre-baked VM images include dependencies and configuration so new MIG VMs become ready quickly, containerized applications start faster and scale in smaller units, and optimized application code reduces initialization time. Together, managed control planes and rapid startup let the architecture add identical capacity in seconds to minutes, shift traffic to healthy resources, and remove idle resources without manual reconfiguration.
A portable workload is an application that moves from one computing environment to another without major changes to its code or to how it is deployed and managed. Portability requires consistent deployment, configuration, visibility, and security across environments so operations work the same way everywhere, supported by a common runtime layer such as Kubernetes and Google Kubernetes Engine (GKE).
Spot VMs provide access to unused VM capacity at more than 80% cheaper than regular VMs without a commitment and should be chosen for fault-tolerant and flexible work such as batch jobs that tolerate preemption and do not require high availability. Committed use discounts reward a one-year or three-year commitment and should be chosen for stable, long-running usage that will consume the committed quantity or spend.
Managed Instance Groups are homogeneous groups of Compute Engine VMs that operate as a single scalable unit where the autoscaler adds VMs when load increases and removes VMs when load decreases. Autohealing uses health checks to detect unhealthy VMs and automatically recreates them, while the load balancer sends traffic only to healthy VMs in the group so a failed VM does not receive user requests while its replacement is created.
An online retail company hosts its core ordering service on Google Kubernetes Engine (GKE). The application experiences predictable, massive traffic spikes every morning at the start of business hours, followed by minimal activity overnight.
To ensure responsiveness during the morning rush, the team currently maintains a high static minReplicas value in the Horizontal Pod Autoscaler (HPA) configuration. However, management noticed that this setting prevents the cluster from scaling down during off-peak night hours, resulting in substantial unnecessary infrastructure costs.
You need to design a scaling architecture that handles the predictable morning surges without overpaying for idle capacity overnight.
Which scaling strategy should you implement?
Last updated