PCD Designing cloud-native applications

A worker Deployment on GKE should add replicas when a Pub/Sub subscription's backlog grows and remove them when the backlog drains. Which combination makes this work?

Show answer and explanation

Answer: C

The Horizontal Pod Autoscaler can scale on external metrics, but it needs an adapter to read them. The Custom Metrics Stackdriver Adapter serves Cloud Monitoring metrics, including Pub/Sub backlog figures, to the Kubernetes metrics API. The autoscaler then raises or lowers the replica count based on that value. The Vertical Pod Autoscaler resizes individual pods rather than changing how many there are, and the cluster autoscaler only changes the number of nodes.

Why the other options are wrong

  • A. Cloud Build and Cloud Deploy build and release artifacts. They do not observe queue depth and cannot change replica counts at runtime.
  • B. A schedule that runs every minute scales by time rather than by backlog, so it cannot react to bursts or shrink accurately when the queue is actually empty.
  • D. The Vertical Pod Autoscaler changes resource requests of pods rather than their number, and the cluster autoscaler adds nodes for pending pods. Neither one reads the Pub/Sub backlog.

Keep going. 135 PCD questions, answers explained after each one.

Practise this domain

Reviewed November 2026. Spotted a problem with this question? Report it from the practice tool.