Prepare and test your skills

Prepare and test your skills

The advantages of using containers in application modernization are lower resource use, faster and more flexible releases, and consistent behavior across environments. A container is a lightweight package that holds an application and its dependencies without a full operating system. When that package runs on managed platforms like Google Kubernetes Engine (GKE) (opens in a new tab), teams pack more work onto fewer machines and let Google Cloud handle scaling, patching, and infrastructure.
Resource efficiency describes how much compute and memory each workload needs and how fully each host machine is used. Containers use fewer resources than virtual machines (VMs) because containers share the host operating system kernel instead of booting their own full operating system. A VM carries its own complete operating system, so each VM needs considerably more compute and memory before the application even runs. Because containers allow fine-grained resource allocations, many containers or Pods can run on the same host, start quickly, and leave hardware idle less often.
| Option | What runs on each instance | Resource and cost effect |
|---|---|---|
| Traditional VMs on Compute Engine | Each VM includes a full operating system plus the application | Heavier footprint, more compute and memory per workload, costs continue even when idle |
| Containers on managed platforms | Each container includes app code and dependencies and shares the host operating system | Lighter footprint, greater workload density per host, fast startup that supports scaling |
Managed container services reduce operational work by shifting VM management, patching, and scaling from the team to Google Cloud. GKE offers automatic operating system upgrades with a security-optimized node kernel, while services such as GKE, Cloud Run (opens in a new tab), and Batch automatically adjust resources with demand. This elasticity improves utilization and is more cost-effective for fluctuating or low traffic than paying for idle VMs.
Exam tip: VMs incur costs even when idle, while managed container services can be more cost-effective for fluctuating or low traffic because they scale with demand.
Agility through microservices is the ability to break a large monolith into smaller services that update and scale on their own. A legacy monolith is typically one large codebase that must be redeployed as a whole, while a containerized microservice is commonly a Deployment with a set of load-balanced Pods behind a Service. Tools such as Istio and Knative add traffic management and serverless patterns, and Migrate to Containers can extract an application from a VM into a container image without source code access. The overall flow moves from the VM-based monolith to container images, then to orchestrated microservices.
Independent scaling means each microservice grows or shrinks based on its own traffic. Kubernetes watches demand and health for each Deployment, recreates failed Pods, performs automated rollouts and rollbacks, and runs health checks with Cloud Logging and Cloud Monitoring. GKE adds cluster autoscaling, auto-repairing, auto-upgrading, and regional clusters, while Cloud Run removes cluster management and scales stateless HTTP(S) services per request down to zero during inactivity. Because scaling applies per Deployment or per Cloud Run service, a busy checkout service can add Pods while an idle reporting service stays small.
Environmental consistency means an application behaves the same in development, testing, and production because it carries its runtime with it. A container image is the immutable built artifact that holds the application, its runtime, and its dependencies, while configuration files and secrets are injected at deploy time. Teams build the image once, store it in Artifact Registry, and promote that same tested artifact through development, then quality assurance, and only after validation to production. Rebuilding at each stage can introduce untested differences, so Cloud Build builds and tests once and Cloud Deploy promotes the same artifact forward.
Portability means that same Open Container Initiative (OCI) image, sometimes called a Docker image, can run on GKE, GKE Autopilot, GKE Enterprise, or Cloud Run without being rebuilt. Cloud Foundry droplets are not directly OCI-compatible, so moving to Cloud Run requires a new OCI build using lift-and-shift Dockerizing, Cloud Native Buildpacks, or self-managed Dockerfiles. Linux containers are more lightweight than Windows containers, and .NET applications can use Linux containers to gain deployment options and remove Windows licensing dependency. Security controls including Artifact Analysis scanning and Binary Authorization for signed images ensure only trusted images move between environments.
The advantages of modern cloud application development are better scalability with fewer resources, faster release cycles, and portable operation across environments. Modern development packages apps as containers, splits them into microservices, and runs them with automated orchestration on Google Kubernetes Engine (GKE) (opens in a new tab). That combination lets capacity grow on demand while code moves from commit to production through repeatable pipelines.
Scalability through containers and microservices comes from lightweight packaging plus independent growth of each service. Containers are standalone packages that include code, runtime, system tools, libraries, and settings but no operating system, so a cluster runs more workloads at higher density with lower cost. A microservices architecture breaks an application into loosely coupled services that release, deploy, and scale separately, so a traffic spike in one part does not force the whole app to scale. Migrate to Containers extracts an image from a VM workload and builds a Docker image for GKE or Cloud Run without source access, enabling rolling updates, dynamic scaling, self-healing, and CI/CD with Cloud Build.
A stateless service does not keep local persistent data, so each request is handled independently and instances, nodes, or Pods can be created or destroyed unexpectedly. Statelessness matters for autoscalers because capacity can be added or removed without losing in-flight data, while stateful and stateless parts should be separated clearly. Kubernetes detects when a Pod is down and recreates it, autoscales Pods, performs rollouts and rollbacks, and runs health checks, while GKE adds cluster autoscaling, regional highly available control planes, and automatic operating system upgrades. Distributed microservices still need protection against cascading failure using circuit breakers, exponential backoffs, and graceful degradation.
Speed of innovation is turning an idea into a production feature faster through automation. Continuous integration (CI) builds, packages, and tests the application before deployment, while continuous delivery (CD) takes the artifact from CI and deploys it frequently through highly automated steps. Cloud Build handles CI by watching the source repository with a trigger, rebuilding the container on commit, storing artifacts, and running tests. Cloud Deploy handles CD by managing delivery to target environments in a defined promotion sequence.
Code flows from source to production in a fixed order:
A left-to-right flow from Cloud Build to Artifact Registry image v1, then the same image promoted through Dev, Quality Assurance, and Production with config injected at deploy and no rebuild.
This image-based flow supports rolling updates, canary releases, and blue/green deployments where traffic shifts gradually to the new revision.
Exam tip: Build the container image once in CI and promote that same tested image through staging to production; do not rebuild the image for each environment.
Portability across environments means moving an app without major changes while keeping deployment, visibility, configuration, and security consistent. Containers and Kubernetes provide an abstraction layer that hides differences between development, testing, production, on-premises, and other clouds. GKE can run modern apps at scale, manage multi-cluster fleets, provide consistent governance with GKE Multi-Cloud and GKE Enterprise, and connect services with end-to-end mutual TLS (mTLS). Infrastructure as code with Terraform, configuration tools like Ansible, Puppet, or Chef, and consistent observability with Cloud Logging, Cloud Monitoring, and Cloud Trace further unify provisioning and monitoring.
The modernization path determines how much the operational model changes:
| Approach | What it does | Choose when |
|---|---|---|
| Migrate to VMs lift-and-shift | Moves VM workloads into Compute Engine instances | Simplest path is needed and minimal change is preferred |
| Migrate to Containers | Containerizes VM apps for GKE or Cloud Run | Goal is to use cloud tools, orchestration, and managed services |
Portability has limits because compute, networking, security, load balancer behavior, and proximity to dependencies can differ by environment. Moving workloads may require moving data, which raises complexity for large datasets and regulated storage locations. Hybrid designs can also increase attack surface if systems and data are widely distributed.
Continue with this study guide: Discuss the advantages of modern cloud application development.
The difference between virtual machines and containers is what each package includes and how that choice affects cost, startup, and management. A virtual machine includes a full operating system, while a container packages only the application and its libraries and relies on the host operating system. On Google Cloud, Compute Engine (opens in a new tab) runs VMs that preserve the existing management model, while containers enable denser, more portable, and more automated operations.
Virtual machines remain the preferred choice when the goal is to preserve the operating system, configuration, and practices with minimal change. Migrate to VMs moves workloads into Compute Engine instances and modernizes only underlying infrastructure while the application keeps running as before. This pathway fits a single VM, testing and development, workloads that must run in privileged mode, and teams less familiar with managed options. Staying on VMs can still add instance templates, managed instance groups (MIGs) with autoscaling, autohealing, regional deployments, and rolling updates.
Running containers directly on VMs uses startup scripts for basic single-VM cases and cloud-init for multiple containers, multiple VMs, or advanced setup such as creating users, mounting disks, or importing files. Using startup scripts or cloud-init does not change Compute Engine costs because the team still pays for underlying VM resources and owns setup, security, and maintenance. The older konlet agent that used the gce-container-declaration metadata key is deprecated, so new work must use docker run in a startup script or cloud-init.
Structural differences in packaging explain why containers are lighter and more portable than VMs. A VM on Compute Engine runs a full operating system image with software installed on top, so the developer must track runtime dependencies and resolve library conflicts manually. A container carries its app and required libraries together and is isolated from host operating system apps and libraries, so it moves between environments without fixing version conflicts on each host. Because containers require considerably fewer compute and memory resources, a cluster achieves greater density with fine-grained allocations, which lowers infrastructure cost as service count grows.
Side-by-side layered stacks comparing a VM host with full guest OS per VM versus a container host where two containers share one host OS kernel and runtime for higher density.
GKE places multiple containers and Pods on each instance to use host resources more efficiently, while running each microservice on its own VM makes operating system overhead a large part of cost. Containers also start faster because they launch from registry images via the container runtime rather than booting a full system, which supports rapid scaling and recovery. Direct container deployment on Compute Engine suits simple single-container cases because only one container can run per instance, only Container-Optimized OS images can be used, ports cannot be remapped, and images must come from a public repository or accessible Artifact Registry or Container Registry.
Choosing a managed container option means trading direct VM control for less operational work and automatic elasticity. Managed services shift patching, scaling, and host management to Google Cloud, adjust resources with demand, and can cost less than over-provisioned or idle VMs. Moving to them requires upfront change such as making apps stateless, using external state services, or adopting Kubernetes manifests.
| Solution | Best for | Cost and management tradeoff |
|---|---|---|
| VMs with startup scripts or cloud-init | Single VM, testing, privileged mode, staying on MIGs | Team owns VM setup and pays even when idle |
| Cloud Run | Stateless apps and small to medium jobs | Platform handles elasticity, scales with demand |
| Batch | Batch jobs with a definite end state needing extra compute | Platform manages execution, efficient for finite jobs |
| GKE (opens in a new tab) | Existing cluster or workloads needing advanced control | Cluster orchestration with auto-repair and scaling |
Cloud Run is a regional service replicated across zones that adds capacity when requests rise and reduces it when they fall, with a free tier for small work. GKE groups Compute Engine instances into a cluster where the control plane manages node pools, load balancing, auto-repair, scaling, upgrades, logging, and monitoring. The control plane manages the cluster boundary while application containers run on nodes inside it.
Exam tip: Stay on Compute Engine with startup scripts to keep VM control, choose Cloud Run for stateless services, Batch for jobs with a definite end state, and GKE for advanced control across many containers.
Continue with this study guide: Differentiate between virtual machines and containers.
The main benefits of containers and microservices for application modernization are faster independent releases, lower cost through better density, and less technical debt through managed services. A container holds an application and all its dependencies so it runs the same everywhere, while a microservice is a small service that deploys and scales on its own. Together they replace a hard-to-change monolith with portable services that run on GKE and Cloud Run.
Faster releases happen because each microservice deploys independently without rebuilding the whole monolith. Cloud Build automates builds, tests, environment provisioning, and vulnerability scans, while image-based management enables rolling updates, dynamic scaling, and self-healing. GKE adds automated rollouts and rollbacks, health checks, cluster autoscaling, and auto-upgrading, and Cloud Run deploys in seconds with revisions and traffic splitting for gradual shifts. Migrate to Containers extracts an image from a VM workload without source access, bringing CI/CD integration and modern operations to legacy apps.
Lower cost comes from optimized utilization because containers omit the operating system and pack densely onto hosts. GKE packs multiple Pods onto the same VMs, which can reduce VM count and Windows licensing costs, and Linux containers run more efficiently than Windows containers on more platforms. Cloud Run autoscales by default, bills for request duration, and scales to zero during inactivity, while GKE supports cluster autoscaling and preemptible VMs. Reduced technical debt follows when self-managed infrastructure is replaced with Cloud SQL, Pub/Sub, Identity-Aware Proxy (IAP), Cloud KMS, and Secret Manager.
| Hosting option | Management model | Best fit |
|---|---|---|
| GKE | Managed Kubernetes with node and cluster control, or Autopilot management | Many containers, long-running processes, non-HTTP protocols, fine-grained control |
| Cloud Run | Serverless containers with no cluster to manage | Stateless HTTP microservices and autoscaled frontends |
Exam tip: Cloud Run is the default for stateless HTTP containers, while GKE is the default for long-running processes or non-HTTP protocols.
Modular updates let one component image be rebuilt and replaced without touching other components. When an app is containerized, each part such as Tomcat, Apache2, or Windows IIS is packaged as its own image with its own version and release schedule. Migrate to Containers plugins such as tomcat-discovery, apache, jboss, and linux-extraction are versioned separately, so releases like 1.4.11 through 1.4.19 fix one image without rebuilding the rest. Updating the software layer inside a workload follows a fixed order: first edit the Dockerfile FROM version tag, then build a new workload image, and only after that apply the new image to existing deployments.
Dependency boundaries make explicit what runs inside the container and which external systems it needs. Tomcat checks flag database connections, web connections, network mounts, and exported NFS, so the deployment cluster must reach those external databases and servers. Windows IIS checks flag unsupported Windows versions, virtual directories on network drives, and Active Directory identities, requiring upgrades, local drives, or a Group Managed Service Account (GMSA). Apache2 checks flag SSL, version, location, and modules, requiring manual SSL configuration and standard paths like /etc/apache2. Because each component is checked and versioned separately, a change applies to that deployment rather than the whole application.
Portability from development to production means the same containerized workload runs the same way in every environment without reworking the app. The container package travels as one image containing code, runtime, system tools, system libraries, and settings, which removes most “works here but not there” problems. Teams build once, test that exact immutable artifact, and promote it in order from development to quality assurance to production. Compared with running directly on a VM, multiple containers sharing the same host are also more efficient.
Lift-and-shift with Migrate to VMs preserves the on-premises way of running apps on Compute Engine instances, while Migrate to Containers converts VM workloads for GKE, GKE Autopilot, GKE Enterprise, or Cloud Run (opens in a new tab) without rewriting. Image-based management then enables rolling updates, dynamic scaling, self-healing, and Cloud Build integration. The result is deployment flexibility where teams choose where and when to deploy while keeping behavior consistent.
The business value of using Google Cloud products to deploy containers is higher reliability with less manual work on GKE and faster, pay-per-use agility on Cloud Run. Google Kubernetes Engine (GKE) (opens in a new tab) is a managed Kubernetes platform that automates deployment, scaling, upgrading, and monitoring for complex and stateful workloads. Cloud Run (opens in a new tab) is a fully managed serverless platform that runs containers without clusters and scales to zero when idle.
Orchestration with GKE works by grouping Compute Engine VMs as nodes into a cluster managed through the Kubernetes API. The control plane is a set of management nodes that run the API server and system components, and Google Cloud manages the control plane for all clusters. In Autopilot mode Google Cloud also manages worker nodes, while in Standard mode the team manages worker nodes. Deployment follows a fixed order: first package the app into containers, then deploy sets of containers as Pods to nodes, then use the Kubernetes API to administer, scale, and monitor.
| Mode | Node management | Billing and reliability |
|---|---|---|
| GKE Autopilot | Google manages control plane and worker nodes | Pay only for Pod requests, Pod-level SLA, built-in hardening |
| GKE Standard | Google manages control plane, team manages nodes | Pay for all node resources, flexible upgrades, scale to 65,000 nodes |
Automation shifts routine work to the platform, including node scaling, Cluster Autoscaler that resizes pools for pending Pods, node auto-repair, managed upgrades with release channels and maintenance windows, built-in logging and monitoring, CI/CD with Cloud Build, Cloud Deploy, and Artifact Registry, and security with hardened Container-Optimized OS and Policy Controller. Reliability comes from greater than 99% monthly uptime objectives, highly available control planes and nodes in regional clusters, and traffic flow from clients through network or HTTP(S) load balancers to Pods across nodes. GKE best fits stateful inventory services needing persistent volumes and complex microservices like recommendation engines needing fine-grained control.
Exam tip: GKE Autopilot manages both the control plane and worker nodes, while GKE Standard manages the control plane but leaves node management to you.
Serverless agility with Cloud Run comes from removing clusters, node pools, and VM fleets from team responsibilities. Traffic flows from incoming requests to Cloud Run, which routes each request to backend container instances with built-in load balancing. Each revision scales out to handle all incoming requests and scales back when demand falls, scaling to zero by default or keeping instances warm with a minimum-instances setting to avoid cold starts. Cloud Run supports services that respond to web requests and jobs that run background tasks then exit, built from functions, source code, or prebuilt images.
Pay-per-use billing charges only for time code is actually running, rounded up to the nearest 100 milliseconds, so idle periods with no traffic produce no compute charge. This contrasts with always-on VMs that charge even when idle and GKE clusters that charge per cluster per hour. Cloud Run also offers a free tier for small workloads and testing, which lowers cost for variable, spiky, or low-traffic services. Workloads that gain most are stateless frontends, mobile backends, APIs built with Nginx, Express.js, or Django accessing Cloud SQL, batch catalog updates, and event-driven tasks responding to messages or schedules.
Portability across GKE and Cloud Run means the same standard container image can deploy on either runtime without modification. The shared ecosystem keeps images in Artifact Registry and delivers them with Cloud Deploy to either runtime or both in parallel. Compatibility comes from standard images as deployment artifacts, a declarative Kubernetes-compatible API model where Deployments, Services, and autoscalers translate between platforms, and standard YAML resource structure. Metrics flow from both runtimes to Cloud Logging and Cloud Monitoring, and a Global external Application Load Balancer can split traffic across both for gradual migration.
Matching the service to requirements means choosing control for customization and simplicity for speed. GKE fits complex microservices, stateful data services, and workloads needing custom storage, networking, or resource allocation with pay-per-cluster pricing. Cloud Run fits stateless, request-driven or event-driven web services, APIs, and periodic batch work with automatic scaling and pay-per-use billing. A hybrid strategy can run both together, with Cloud Run carrying variable stateless services and GKE carrying stateful or complex services.
Virtual machines include a full operating system plus the application, while containers package only the application and its libraries and share the host operating system kernel. Because containers avoid booting a full operating system, they use less compute and memory, start faster, and allow greater workload density with many containers or Pods on the same host.
Cloud Run is best for stateless HTTP microservices, APIs, and jobs that can scale per request and scale to zero during inactivity, with billing only for time code is actually running rounded up to the nearest 100 milliseconds. Google Kubernetes Engine (GKE) is best for stateful services needing persistent volumes, long-running processes, non-HTTP protocols, and complex microservices needing fine-grained control over clusters, networking, and storage.
Container images are immutable artifacts that should be built once, stored in Artifact Registry, and promoted as the same tested artifact through development, then quality assurance, and only after validation to production. Configuration files and secrets are injected at deploy time, and rebuilding at each stage should be avoided because it can introduce untested differences.
Last updated