Courseiva

AZ-204 Practice Question: Monitor, troubleshoot, and optimize Azure solutions

You deploy a microservices architecture on Azure Kubernetes Service (AKS). Some pods report OOMKilled errors. Which diagnostic step should you take first?

⚠ Common exam trap

The trap here is that candidates often jump to scaling solutions (cluster autoscaler or HPA) or node-level monitoring, overlooking that OOMKilled is a container-level limit violation that must be diagnosed by examining the pod's resource configuration first.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Review container resource requests and limits in the pod YAML

The OOMKilled error indicates that a container exceeded its memory limit. The first diagnostic step is to review the container's resource requests and limits in the pod YAML to determine if the memory limit is set too low for the workload. This directly addresses the root cause before scaling or checking node-level metrics.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Enable cluster autoscaler to add more nodes

    Why it's wrong here

    Enabling the cluster autoscaler adds more worker nodes to the Kubernetes cluster when there are pending pods that cannot be scheduled due to insufficient node resources, or when existing nodes are under pressure. However, an OOMKilled event signifies that a specific container within a pod has exceeded its *configured* memory limit, not that the cluster lacks available nodes. Adding more nodes will not increase the memory allocated to an already running pod that is hitting its individual resource ceiling.

  • Review container resource requests and limits in the pod YAML

    Why this is correct

    An OOMKilled (Out Of Memory Killed) event is a direct indication that a container process attempted to consume more memory than the `resources.limits.memory` value specified in its pod's YAML definition. Reviewing these container resource limits is the most direct and effective action, as it allows you to identify if the allocated memory is insufficient for the application's actual workload. Adjusting these limits, after proper profiling, directly addresses the root cause of the termination.

  • Check node memory utilization with kubectl top nodes

    Why it's wrong here

    `kubectl top nodes` provides an aggregated view of CPU and memory utilization across all worker nodes in the cluster. While useful for assessing overall cluster health and identifying potential node-level bottlenecks, it does not provide insight into why a *specific container* within a pod was terminated due to exceeding its individual memory limit. A node might have significant free memory, yet a pod on it can still be OOMKilled if its own defined memory limit is too low, making this command irrelevant to the immediate problem.

  • Configure horizontal pod autoscaler based on memory

    Why it's wrong here

    Configuring the Horizontal Pod Autoscaler (HPA) based on memory utilization will scale out the number of pod replicas when the average memory usage across existing pods exceeds a defined threshold. However, HPA only creates *more instances* of a pod; it does not modify the `resources.limits.memory` for individual containers within those pods. Therefore, an existing pod that is already experiencing OOMKilled due to an insufficient memory limit will continue to be terminated, even if more replicas are launched.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.