
Answer-first summary for fast verification
Answer: Create a Cloud Build trigger based on the 'develop' branch that tests the code, builds the container, and stores it in Container Registry. Create a deployment pipeline that monitors for new images and deploys the new image on the development cluster. Ensure that only the deployment tool has access to deploy new versions.
Option A and B involve manual steps by developers (pre-commit or post-commit hooks) and manual deployment, which do not ensure a consistent and automated process for all code changes. Option D relies on Vulnerability Scanning to ensure code test success, which is not a comprehensive approach to testing the code and ensuring it is properly built before deployment. Option C is the correct choice because it sets up an automated CI/CD pipeline using Cloud Build triggers to test the code, build the container, store it in Container Registry, and deploy the new image to the development cluster. This approach ensures consistency, automation, and security by allowing only the deployment tool to manage the deployments.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your team is embarking on developing a new application using a microservices architecture deployed on Google Kubernetes Engine (GKE). To maintain a robust development lifecycle, any code change pushed to the remote 'develop' branch on your GitHub repository should undergo automated build and testing processes. Upon passing these stages successfully, the appropriate microservice should be automatically deployed to the development environment. You need to ensure that all code deployed in this environment strictly adheres to this workflow. What should you do?
A
Have each developer install a pre-commit hook on their workstation to test the code and build the container when committing to the 'develop' branch. After a successful commit, have the developer deploy the newly built container image to the development cluster.
B
Install a post-commit hook on the remote Git repository to test the code and build the container when code is pushed to the 'develop' branch. After a successful commit, have the developer deploy the newly built container image to the development cluster.
C
Create a Cloud Build trigger based on the 'develop' branch that tests the code, builds the container, and stores it in Container Registry. Create a deployment pipeline that monitors for new images and deploys the new image on the development cluster. Ensure that only the deployment tool has access to deploy new versions.
D
Create a Cloud Build trigger based on the 'develop' branch to build a new container image and store it in Container Registry. Rely on Vulnerability Scanning to ensure the code tests succeed. As the final step of the Cloud Build process, deploy the new container image on the development cluster. Ensure that only Cloud Build has access to deploy new versions.