Google Professional Cloud DevOps Engineer Question 214
Select 3Google Cloud PlatformYour team is building a CI/CD pipeline for a microservices-based application deployed on Google Kubernetes Engine (GKE). The pipeline must ensure that only tested and approved code is deployed to production while minimizing downtime. Which of the following steps should you include in your CI/CD pipeline to achieve this goal?
- A
Use a canary deployment strategy to gradually roll out changes to a subset of users.
- B
Run automated integration tests after deployment to production.
- C
Integrate a static code analysis tool to identify potential code issues during the build stage.
- D
Implement a rollback mechanism to automatically revert to the previous version in case of deployment failure.
- E
Use a custom script to manually approve deployments to production.
Show answer and explanation
Correct answers: A, C, D
Explanation
To build a robust CI/CD pipeline for a GKE-based application, it is critical to ensure code quality (via static analysis), safely deploy changes (via canary deployments), and have mechanisms to handle failures (via rollbacks). Automated integration testing should occur before deployment to production, and manual steps should be minimized to align with DevOps automation principles.
- A. Correct.
Correct: Canary deployments allow gradual exposure of changes to users, reducing the risk of system-wide issues and enabling safe rollouts.
- B. Incorrect.
Incorrect: Automated integration tests should generally run before deployment to production to catch issues earlier in the pipeline.
- C. Correct.
Correct: Static code analysis tools help identify potential code issues during the build stage, ensuring higher code quality before deployment.
- D. Correct.
Correct: A rollback mechanism is essential to minimize downtime and quickly recover from deployment failures.
- E. Incorrect.
Incorrect: Manual approval introduces delays and is not aligned with the goal of automating CI/CD pipelines.