DOP-C02 Question 43
Select 3Your team is deploying a containerized application on Amazon Elastic Kubernetes Service (EKS). To enhance scalability and reliability, you want to ensure that the application pods automatically scale up or down based on CPU and memory usage. Which of the following steps should you take to implement this solution?
- A
Configure a Kubernetes Horizontal Pod Autoscaler (HPA) with CPU and memory resource metrics.
- B
Set up an AWS Auto Scaling group for the EC2 instances in your EKS cluster.
- C
Enable the Kubernetes Metrics Server in your EKS cluster.
- D
Use an AWS Lambda function to monitor pod resource usage and scale the pods dynamically.
- E
Define resource requests and limits for CPU and memory in the application pod specifications.
Show answer and explanation
Correct answers: A, C, E
Explanation
To implement pod autoscaling on EKS, you need to configure a Kubernetes Horizontal Pod Autoscaler (HPA) and ensure that the Kubernetes Metrics Server is enabled to provide resource usage data. Additionally, you must define resource requests and limits for CPU and memory in your pod specifications, as these values are critical for HPA to function properly. While AWS Auto Scaling groups ensure sufficient infrastructure capacity, they do not handle pod-level scaling.
- A. Correct.
Correct: Kubernetes Horizontal Pod Autoscaler (HPA) is used to scale pods automatically based on resource metrics such as CPU and memory usage.
- B. Incorrect.
Incorrect: AWS Auto Scaling groups are used to scale EC2 instances, not Kubernetes pods. While they are important for ensuring sufficient cluster capacity, they do not handle pod-level scaling.
- C. Correct.
Correct: The Kubernetes Metrics Server is required to provide the resource usage metrics (CPU, memory, etc.) that the HPA uses to make scaling decisions.
- D. Incorrect.
Incorrect: AWS Lambda is not a standard tool for scaling Kubernetes pods. Pod autoscaling is typically managed natively within Kubernetes using HPA.
- E. Correct.
Correct: Resource requests and limits must be defined in the pod specifications to enable proper scaling decisions by the HPA.