Google Professional Cloud Developer

Google Professional Cloud Developer

Get started today

Ultimate access to all questions.


How can you configure alerts in Google Kubernetes Engine (GKE) to notify your team when the average memory consumption of containers falls below 20% or exceeds 80%?




Explanation:

The correct approach is to use Cloud Monitoring's built-in alerting policies. Cloud Monitoring natively collects metrics from GKE, including container memory usage. Creating an alerting policy (Option B) allows direct configuration of thresholds (below 20% or above 80%) without custom code. Options A, C, and D involve unnecessary complexity, custom scripting, or incorrect metric sources (e.g., OS-level metrics in Option D do not reflect container-specific usage). Cloud Monitoring is the recommended and simplest solution for this use case.