Continuous Deployment Pipeline for Git Source Repository | Professional Cloud Architect Exam | Google

Code Verification and Deployment in Continuous Deployment Pipeline

Question

You are building a continuous deployment pipeline for a project stored in a Git source repository and want to ensure that code changes can be verified before deploying to production.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/blob/master/README.md

The best approach to building a continuous deployment pipeline for a project stored in a Git source repository is to ensure that code changes can be verified before deploying to production. This can be achieved in several ways, but the most appropriate method depends on various factors such as the size of the project, team size, and project goals.

Option A: Use Spinnaker to deploy builds to production using the red/black deployment strategy so that changes can easily be rolled back. This option involves using Spinnaker to deploy builds to production using the red/black deployment strategy, which allows for easy rollback of changes. This method involves creating two identical production environments (red and black), deploying code changes to the black environment for testing, and if successful, redirecting traffic to the black environment. This ensures that if there are any issues with the new code, traffic can be easily redirected back to the previous version. This method is suitable for large projects with a team that can manage Spinnaker effectively.

Option B: Use Spinnaker to deploy builds to production and run tests on production deployments. This option involves using Spinnaker to deploy builds to production and run tests on production deployments. This is not recommended as testing in production can lead to customer dissatisfaction and damage to a project's reputation. This method is not suitable for any project that has any public-facing components or any that want to maintain a reputation of reliability.

Option C: Use Jenkins to build the staging branches and the master branch. Build and deploy changes to production for 10% of users before doing a complete rollout. This option involves using Jenkins to build the staging branches and the master branch, followed by deploying changes to production for 10% of users before doing a complete rollout. This method is suitable for smaller projects that do not require a lot of infrastructure and can be managed with Jenkins. However, deploying to only 10% of users may not be enough to fully test changes in a production environment.

Option D: Use Jenkins to monitor tags in the repository. Deploy staging tags to a staging environment for testing. After testing, tag the repository for production and deploy that to the production environment. This option involves using Jenkins to monitor tags in the repository, deploy staging tags to a staging environment for testing, and after testing, tag the repository for production and deploy that to the production environment. This method is suitable for smaller projects that do not require a lot of infrastructure and can be managed with Jenkins. However, this method requires manual intervention to tag the repository for production, which may lead to errors or inconsistencies.

In conclusion, the best approach is to use option A: Use Spinnaker to deploy builds to production using the red/black deployment strategy so that changes can easily be rolled back. This approach ensures that code changes are thoroughly tested before being deployed to production, and the ability to easily roll back changes ensures that issues can be addressed quickly if any problems arise.