AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 326
A DevOps team is deploying microservices for an application on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster. The cluster uses managed node groups. The DevOps team wants to enable auto scaling for the microservice Pods based on a specific CPU utilization percentage. The DevOps team has already installed the Kubernetes Metrics Server on the cluster.
Which solution will meet these requirements in the MOST operationally efficient way?
Answer options
- A. Edit the Auto Scaling group that is associated with the worker nodes of the EKS cluster. Configure the Auto Scaling group to use a target tracking scaling policy to scale when the average CPU utilization of the Auto Scaling group reaches a specific percentage.
- B. Deploy the Kubernetes Horizontal Pod Autoscaler (HPA) and the Kubernetes Vertical Pod Autoscaler (VPA) in the cluster. Configure the HPA to scale based on the target CPU utilization percentage. Configure the VPA to use the recommender mode setting.
- C. Run the AWS Systems Manager AWS-UpdateEKSManagedNodeGroup Automation document. Modify the values for NodeGroupDesiredSize, NodeGroupMaxSize, and NodeGroupMinSize to be based on an estimate for the required node size.
- D. Deploy the Kubernetes Horizontal Pod Autoscaler (HPA) and the Kubernetes Cluster Autoscaler in the cluster. Configure the HPA to scale based on the target CPU utilization percentage. Configure the Cluster Autoscaler to use the auto-discovery setting.
Correct answer: D
Explanation
To scale Pods based on CPU utilization, the Kubernetes Horizontal Pod Autoscaler (HPA) must be deployed to utilize metrics from the Metrics Server. However, scaling up Pods can lead to resource exhaustion on the existing nodes, which requires the Kubernetes Cluster Autoscaler to automatically adjust the size of the EKS managed node group. Other solutions either scale the underlying EC2 instances directly without scaling the Pods themselves (A and C) or fail to scale the cluster's physical capacity when Pod replicas exceed node limits (B).