2V0-71.23 Question 291
Select 3You are managing a Kubernetes cluster using VMware Tanzu Kubernetes Grid (TKG) and have deployed multiple applications. One application is experiencing unpredictable traffic spikes, and you need to ensure that the application scales automatically based on CPU usage. Which of the following steps should you take to configure autoscaling for this application?
- A
Deploy a Horizontal Pod Autoscaler (HPA) for the application and configure CPU utilization thresholds.
- B
Enable Vertical Pod Autoscaling (VPA) to dynamically adjust the resource limits of the application pods.
- C
Configure a Kubernetes Custom Resource Definition (CRD) for advanced autoscaling policies.
- D
Annotate the application deployment with resource requests and limits for CPU and memory.
- E
Install a monitoring solution like Prometheus to provide metrics required for HPA.
Show answer and explanation
Correct answers: A, D, E
Explanation
To configure autoscaling for an application in a Kubernetes cluster managed by Tanzu Kubernetes Grid, you need to use a Horizontal Pod Autoscaler (HPA) to automatically adjust the number of pods based on CPU/memory utilization. Proper resource requests and limits must be configured for the application deployment to enable HPA to calculate utilization percentages. Additionally, a monitoring solution like Prometheus is required to provide the metrics that HPA relies on to make scaling decisions. Vertical Pod Autoscaling (VPA) and CRDs are not directly relevant in this context.
- A. Correct.
Correct: A Horizontal Pod Autoscaler (HPA) is used to automatically adjust the number of pods in a deployment based on observed CPU/memory utilization or custom metrics.
- B. Incorrect.
Incorrect: Vertical Pod Autoscaling (VPA) adjusts resource requests and limits for individual pods but does not scale the number of pods. It is not suitable for handling traffic spikes.
- C. Incorrect.
Incorrect: Kubernetes Custom Resource Definitions (CRDs) are used to define custom resources, but they are not specifically used for configuring autoscaling.
- D. Correct.
Correct: Resource requests and limits must be set for HPA to function effectively, as it uses these values to calculate utilization.
- E. Correct.
Correct: HPA relies on metrics to make scaling decisions. Installing a monitoring solution like Prometheus ensures the required metrics are available for HPA to function.