Identify the commands used to create a Horizontal Pod Autoscaler to maintain an average CPU utilization across all pods of 50% and check the current status of Autoscaler.
Understand the Problem
The question is asking for the correct commands to create a Horizontal Pod Autoscaler (HPA) with a specific average CPU utilization and to check its status. The user needs to identify the appropriate commands from the given options.
Answer
Use `kubectl autoscale deployment <name> --cpu-percent=50 --min=1 --max=10` to create an HPA. Check status with `kubectl get hpa`.
To create a Horizontal Pod Autoscaler with average CPU usage target of 50%, use kubectl autoscale deployment <name> --cpu-percent=50 --min=1 --max=10
. To check the status, use kubectl get hpa
.
Answer for screen readers
To create a Horizontal Pod Autoscaler with average CPU usage target of 50%, use kubectl autoscale deployment <name> --cpu-percent=50 --min=1 --max=10
. To check the status, use kubectl get hpa
.
More Information
The Horizontal Pod Autoscaler automatically adjusts the number of pods in a deployment based on CPU utilization, among other metrics, ensuring the application can handle the load.
Tips
A common mistake is to miss specifying minimum (--min
) and maximum (--max
) pods, which might lead to autoscaling not working as intended.
Sources
- Horizontal Pod Autoscaling - Kubernetes - kubernetes.io
AI-generated content may contain errors. Please verify critical information