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
From the Global view, open the project that you want to deploy a HPA to.
Click Resources > HPA.
Click Add HPA.
Enter a Name for the HPA.
Select a Namespace for the HPA.
Select a Deployment as scale target for the HPA.
Specify the Minimum Scale and Maximum Scale 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.
Result: 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
From the Global view, open the project with the HPAs you want to look at.
Click Resources > HPA. The HPA tab 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
From the Global view, open the project that you want to delete an HPA from.
Click Resources > HPA.
Find the HPA which you would like to delete.
Click ⋮ > Delete.
Click Delete to confirm.
Result: The HPA is deleted from the current cluster.