Improve GKE Deployment Rollback and Image Cleanup
Short answer
B Adopt Cloud Deploy for managing deployments, and implement an Artifact Registry cleanup policy.
Question
Key Takeaways
The main trap is choosing custom scripting over managed services; Cloud Deploy provides native rollback automation, while Artifact Registry cleanup policies offer zero-overhead image retention management.
Learn how to resolve production deployment failures and image bloat in GKE by adopting Cloud Deploy for native rollout management and using Artifact Registry cleanup policies for automated maintenance.
Common mistake: Choosing Option A (Cloud Build rollback pipeline) is common because teams may already use Cloud Build, but it misses the dedicated deployment orchestration and native cleanup features provided by Cloud Deploy and Artifact Registry policies.
Expert Analysis
Native Rollout and Rollback Management The scenario describes a CI/CD pipeline using Cloud Build and Artifact Registry, but lacks a dedicated deployment orchestration tool for GKE. The failure stems from untested integration functionality reaching production, necessitating a disruptive manual rollback. To solve this, you need a service that provides native promotion controls between environments (dev, pre-prod, prod) and automated rollback capabilities. Cloud Deploy is Google's managed service specifically designed for this purpose. It allows you to define delivery pipelines with approval gates and automatic rollbacks if health checks fail, eliminating the need for manual intervention during failures.
Automated Image Cleanup Regarding the accumulation of old container images in Artifact Registry, the most efficient and Google-recommended approach is to use cleanup policies. These policies can be configured to automatically delete images based on criteria such as age, tag patterns, or number of retained versions. This is superior to scheduling custom Cloud Build jobs (Option D) because it is a zero-overhead, native feature integrated directly into Artifact Registry, reducing operational complexity and potential errors in custom scripts.
Why Other Options Are Incorrect
- Option A suggests setting up a rollback pipeline in Cloud Build. While possible, this requires significant custom scripting and does not provide the streamlined, native rollout management that Cloud Deploy offers.
- Option C proposes using Cloud Service Mesh. While Istio (part of Cloud Service Mesh) can handle traffic shifting and rollbacks, it adds significant infrastructure overhead and complexity compared to Cloud Deploy for simple application deployment lifecycle management. Manual cleanup is also inefficient.
- Option D uses Cloud Deploy correctly but relies on a scheduled Cloud Build job for cleanup. This is less optimal than native cleanup policies, which are simpler and more reliable.
The comments support this by highlighting Cloud Deploy for its native rollout/rollback features and Artifact Registry cleanup policies as the zero-overhead solution.
Exam Strategy
When a question mentions 'manual rollback' or 'deployment failures', look for managed deployment orchestration tools like Cloud Deploy rather than custom CI/CD script fixes. For storage cleanup tasks in Google Cloud, always prefer native, serverless features (like Artifact Registry policies) over scheduled compute jobs unless specific complex logic is required.
Frequently Asked Questions
What is the primary benefit of Cloud Deploy over Cloud Build for GKE?
How do Artifact Registry cleanup policies work?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
BlackCoffee 👍 1 Answered BNative Rollout and Rollback Management with Cloud Deploy. Artifact Registry cleanup policies are the Google-recommended, zero-overhead solution.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PCDOE Questions
Access 75 questions with complete answers and detailed explanations.
View Full PCDOE Practice Test →