Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 229


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?

Show Answer
Correct Answer: CD

To automatically promote the application to the Test cluster after a successful deployment to the Dev cluster using Google Cloud Deploy, you should use a Cloud Function that calls the Google Cloud Deploy API to promote the application. This Cloud Function should be triggered by SUCCEEDED messages from the clouddeploy-operations topic. This approach leverages a serverless function, which is scalable and event-driven, and directly responds to deployment success events by using the Cloud Deploy API.

Discussion

9 comments
Sign in to comment
KadhemOption: C
Dec 30, 2023

C in answer. A cannot be the answer as it mention "cloud build" and the question talk about cloud deploy.

TNT87Option: A
Feb 2, 2023

https://cloud.google.com/deploy/docs/integrating#integrating_with_automated_testing https://cloud.google.com/deploy/docs/integrating#before_you_begin

TNT87
Feb 5, 2023

https://cloud.google.com/functions/docs/calling/pubsub mhh i see why it could be C

mrvergaraOption: C
Feb 4, 2023

This option (C) is recommended because it follows the best practice of using a serverless function, specifically Cloud Functions, for triggering automated tasks in response to events. In this case, the function will be triggered by a SUCCEEDED message from the clouddeploy-operations topic, indicating that the deployment to the Dev cluster has completed successfully. The function will then use the Google Cloud Deploy API to promote the application to the Test cluster. Using a Cloud Function in this way allows for a scalable, event-driven architecture and reduces the amount of infrastructure required to manage the deployment process.

mrvergara
Feb 4, 2023

Option A is not better than Option C because it involves using Cloud Build instead of Cloud Functions for the deployment promotion process. While Cloud Build is a powerful tool for building and testing applications, it is generally not recommended for triggering automated tasks in response to events like the successful deployment of an application to a cluster. In Option A, the Cloud Build trigger listens for SUCCEEDED Pub/Sub messages from the clouddeploy-operations topic, and then promotes the application to the Test cluster as part of the Cloud Build pipeline. This approach involves using a more complex and less scalable infrastructure than using a serverless function like Cloud Functions. On the other hand, Option C uses a Cloud Function to promote the application, which is a more streamlined, scalable, and event-driven solution. Cloud Functions are designed specifically for triggering automated tasks in response to events, making them a better choice for this type of use case.

TNT87
Feb 5, 2023

Your explanation is not from the documentation sir, kindly provide a link to your answer. Do you also understtand what and when to use cloud build??

TNT87Option: C
Feb 5, 2023

https://cloud.google.com/functions/docs/calling/pubsub

Pime13Option: A
Feb 26, 2023

https://cloud.google.com/build/docs/automate-builds-pubsub-events#console_2

Pime13
Feb 28, 2023

Cloud Build Pub/Sub triggers enable you to execute builds in response to Google Cloud events published over Pub/Sub. You can use information from a Pub/Sub event to parameterize your build and to decide if a build should execute in response to the event. Pub/Sub triggers can be configured to listen to any Pub/Sub topic.

closer89Option: A
Apr 16, 2023

https://cloud.google.com/functions/docs/calling/pubsub https://cloud.google.com/deploy/docs/integrating#integrating_with_automated_testing cloud deploy sends message cloud build reads this message

purushiOption: A
Aug 8, 2023

Its either A or D. A is better since the topic is clouddeploy-operations. Once the msg is being published to this topic that means deployment has been done successfully to the environment, so the next step is to deploy the containers in the test cluster. So I go with option A.

RajanOption: C
Sep 24, 2023

I think it should be C.

d_ella2001Option: A
Jul 13, 2024

Answer from google's exam practice questions: Correct answer A. 1. Create a Cloud Build trigger that listens for SUCCEEDED Pub/Sub messages from the clouddeploy-operations topic. 2. Configure Cloud Build to include a step that promotes the application to the Test cluster.