Hybrid microservices deployment with Anthos and Cloud Run for Anthos

PCD By islever Editorial Last updated

Short answer

B Create a GKE cluster in each environment with Anthos and deploy the application to both clusters using Cloud Run for Anthos, giving managed hybrid scaling on demand.

Question

You are designing an application that uses a microservices architecture. You are planning to deploy the application in the cloud and on-premises. You want to make sure the application can scale up on demand and also use managed services as much as possible. What should you do?
  1. Deploy open source Istio in a multi-cluster deployment on multiple Google Kubernetes Engine (GKE) clusters managed by Anthos.
  2. Create a GKE cluster in each environment with Anthos, and use Cloud Run for Anthos to deploy your application to each cluster. Correct Answer
  3. Install a GKE cluster in each environment with Anthos, and use Cloud Build to create a Deployment for your application in each cluster.
  4. Create a GKE cluster in the cloud and install open-source Kubernetes on-premises. Use an external load balancer service to distribute traffic across the two environments.

Key Takeaways

Hybrid microservices that must scale on demand with minimal operational overhead are best served by Anthos managing a GKE cluster in each environment, with Cloud Run for Anthos deploying the application to both. Option B wins because it pairs a unified, managed control plane across cloud and on-premises clusters with per-service serverless scaling. The alternatives either leave you operating open source Istio or Kubernetes yourself, misuse Cloud Build as a runtime, or rely on a single external load balancer across environments.

Expert Analysis

B. Cloud Run with microservices provides per-service scaling, scale-to-zero, and per-request billing. GKE (A) has cluster management overhead. Compute Engine (C) is IaaS. App Engine (D) has platform constraints.

The deciding constraint in this scenario is that the application must run both in the cloud and on-premises while using managed services as much as possible, and option B is the only choice that satisfies that pair of conditions at once. Cloud Run for Anthos is Google's managed offering that installs onto a GKE cluster and lets you deploy containerized workloads through a serverless control plane, so the developer-facing surface stays the same in the cloud cluster and in the on-premises cluster. Creating a GKE cluster in each environment with Anthos is the standard Anthos pattern: Anthos provides a unified control plane, fleet management, and policy enforcement over clusters wherever they are installed, which is exactly what a hybrid, multi-environment deployment needs. Scaling on demand is handled per service by Cloud Run for Anthos, which scales revisions of each deployed service independently based on incoming requests, so an individual microservice in the on-premises cluster can grow without touching the cluster's node pool sizing by hand.

Option A fails on both counts. Open source Istio deployed in a multi-cluster fashion across GKE clusters is a service mesh you operate yourself — sidecar injection, control-plane upgrades, certificate rotation, and multi-cluster network plumbing are all your work, which directly contradicts "use managed services as much as possible." It also only names GKE clusters, so it does not address the on-premises half of the deployment requirement. Anthos would be the managed route to that same capability rather than running open source Istio yourself.

Option C misreads what Cloud Build does. Cloud Build is a CI system: it builds images and can kubectl-apply manifests, but the resulting Deployment in a GKE cluster is a plain Kubernetes workload that you manage — pod disruption budgets, HPA tuning, and cluster capacity planning remain yours. "Use Cloud Build to create a Deployment" does not give you a managed runtime, and like option A it says nothing about an on-premises environment, so it cannot deliver the hybrid property the scenario asks for.

Option D splits the stack asymmetrically: GKE in the cloud, self-installed Kubernetes on-premises, and an external load balancer straddling both. Self-installed Kubernetes is the opposite of managed services, and a single external load balancer spanning cloud and on-premises traffic raises latency and availability questions for every request crossing the link, so it is a weak answer to "scale up on demand."

One mechanism this question leans on without stating it is Anthos's fleet concept: registering clusters puts them under one control plane so config and policy are applied uniformly, which is precisely why option B can deploy the same application to "each cluster" while still presenting a managed surface. Note that the reference explanation's labels for options C and D (Compute Engine, App Engine) do not match the actual option text in this item; the option wording itself — Cloud Build creating a Deployment, and a self-managed Kubernetes cluster — is what rules those choices out.

Exam Strategy

When a scenario combines three requirements — hybrid (cloud + on-premises), managed services, and on-demand scaling — score each option against all three, not just one. Eliminate any option that runs a component you would operate yourself (open source Istio, self-installed Kubernetes) or that only addresses the cloud side. Also check what each named service actually does: Cloud Build produces artifacts and manifests, it is not a runtime, so an option built on it is describing CI, not deployment.

Practice All PCD Questions

Access 84 questions with complete answers and detailed explanations.

View Full PCD Practice Test →

← Back to PCD Study Guide