PROFESSIONAL-CLOUD-DEVELOPER · Question #246
You are a developer at a large organization. You are deploying a web application to Google Kubernetes Engine (GKE). The DevOps team has built a CI/CD pipeline that uses Cloud Deploy to deploy the appl
The correct answer is C. 1. Create a Cloud Function that calls the Google Cloud Deploy API to promote the application to. Cloud Deploy publishes Pub/Sub messages for pipeline events, including when a rollout to a target succeeds. The Google-recommended pattern for automatic promotion is: (1) subscribe a Cloud Function to the Cloud Deploy Pub/Sub topic, (2) filter for SUCCEEDED rollout messages targe
Question
You are a developer at a large organization. You are deploying a web application to Google Kubernetes Engine (GKE). The DevOps team has built a CI/CD pipeline that uses Cloud Deploy to deploy the application to Dev, Test, and Prod clusters in GKE. After Cloud Deploy successfully deploys the application to the Dev cluster, you want to automatically promote it to the Test cluster. How should you configure this process following Google-recommended best practices?
Options
- A
- Create a Cloud Build trigger that listens for SUCCEEDED Pub/Sub messages from the
- B
- Create a Cloud Function that calls the Google Cloud Deploy API to promote the application to
- C
- Create a Cloud Function that calls the Google Cloud Deploy API to promote the application to
- D
- Create a Cloud Build pipeline that uses the gke-deploy builder.
How the community answered
(41 responses)- A12% (5)
- B7% (3)
- C76% (31)
- D5% (2)
Explanation
Cloud Deploy publishes Pub/Sub messages for pipeline events, including when a rollout to a target succeeds. The Google-recommended pattern for automatic promotion is: (1) subscribe a Cloud Function to the Cloud Deploy Pub/Sub topic, (2) filter for SUCCEEDED rollout messages targeting the Dev cluster, and (3) have the Cloud Function call the Cloud Deploy API to promote the release to the Test target. Option C describes this flow. Option A uses Cloud Build instead of a Cloud Function to trigger the promotion - less direct and adds an unnecessary build layer. Option B is similar to C but differs in the triggering mechanism. Option D uses a gke-deploy builder and bypasses Cloud Deploy entirely, which contradicts the existing pipeline.
Topics
Community Discussion
No community discussion yet for this question.