Google Professional Cloud DevOps Engineer Question 198
Select 3Google Cloud PlatformYour team is using ephemeral environments for feature development. These environments are created dynamically for each feature branch in your CI/CD pipeline. However, you notice that unused ephemeral environments are often left running, leading to increased costs. How can you efficiently manage and clean up these environments?
- A
Implement a TTL (Time-To-Live) policy on ephemeral environments to automatically delete them after a specified time period.
- B
Configure your CI/CD pipeline to trigger the deletion of ephemeral environments when the associated feature branch is merged or closed.
- C
Use a monitoring tool to manually track and delete unused ephemeral environments.
- D
Leverage labels or tags on resources in ephemeral environments to identify and delete them using automated cleanup scripts.
- E
Disable ephemeral environments entirely and switch to shared staging environments to reduce costs.
Show answer and explanation
Correct answers: A, B, D
Explanation
Managing ephemeral environments involves implementing automated policies and processes to ensure they are used effectively and do not incur unnecessary costs. Strategies like TTL policies, lifecycle-based cleanup, and tagging resources enable efficient management and avoid manual overhead. Disabling ephemeral environments altogether is not a practical solution as it sacrifices the flexibility and isolation they provide.
- A. Correct.
This is a correct option. Implementing a TTL policy ensures that environments are automatically deleted after a certain period, helping to reduce costs and manual intervention.
- B. Correct.
This is a correct option. Tying the cleanup of ephemeral environments to the lifecycle of feature branches ensures environments are only kept as long as they are required.
- C. Incorrect.
This is not a correct option. While monitoring tools can help identify unused environments, manual tracking and deletion are inefficient and prone to human error.
- D. Correct.
This is a correct option. Using labels or tags allows you to programmatically identify and clean up resources associated with ephemeral environments.
- E. Incorrect.
This is not a correct option. Disabling ephemeral environments entirely negates their benefits, such as isolated testing and development, and is not a recommended approach for cost optimization.