Managing HPAs with the Rancher UI
The Rancher UI supports creating, managing, and deleting HPAs. You can configure CPU or memory usage as the metric that the HPA uses to scale.
If you want to create HPAs that scale based on other metrics than CPU and memory, refer to Configuring HPA to Scale Using Custom Metrics with Prometheus.
Creating an HPA
In the upper left corner, click ☰ > Cluster Management.
Go to the cluster you want to create an HPA in and click Explore.
In the left navigation bar, click Service Discovery > HorizontalPodAutoscalers.
Click Create.
Select a Namespace for the HPA.
Enter a Name for the HPA.
Select a Target Reference as scale target for the HPA.
Specify the Minimum Replicas and Maximum Replicas for the HPA.
Configure the metrics for the HPA. You can choose memory or CPU usage as the metric that will cause the HPA to scale the service up or down. In the Quantity field, enter the percentage of the workload's memory or CPU usage that will cause the HPA to scale the service. To configure other HPA metrics, including metrics available from Prometheus, you need to manage HPAs using kubectl.
Click Create to create the HPA.
The HPA is deployed to the chosen namespace. You can view the HPA's status from the project's Resources > HPA view.
Get HPA Metrics and Status
- In the upper left corner, click ☰ > Cluster Management.
- Go to the cluster that has the HPA and click Explore.
- In the left navigation bar, click Service Discovery > HorizontalPodAutoscalers. The HorizontalPodAutoscalers page shows the number of current replicas.
For more detailed metrics and status of a specific HPA, click the name of the HPA. This leads to the HPA detail page.
Deleting an HPA
- In the upper left corner, click ☰ > Cluster Management.
- Go to the cluster that has the HPA you want to delete and click Explore.
- In the left navigation bar, click Service Discovery > HorizontalPodAutoscalers.
- Click Resources > HPA.
- Find the HPA which you would like to delete and click ⋮ > Delete.
- Click Delete to confirm.
The HPA is deleted from the current cluster.