Edit Auto-scaling Settings
This section describes how to edit the auto-scaling settings for a workload. The auto-scaling feature allows the system to automatically adjust the number of pod replicas based on the target CPU and memory usage of all pod replicas in the workload.
Prerequisites
-
You need to join a cluster or project and have the Application Workload Management permission in the cluster or project. For more information, please refer to Cluster Roles and Project Roles.
-
The Metrics Server extension must be installed and enabled on the KubeSphere platform.
Steps
-
Log in to the KubeSphere web console as a user with Application Workload Management permissions and go to your cluster or workspace.
-
Click Application Workloads > Workloads in the left navigation pane.
-
On the Workloads page, click Deployments or StatefulSets, then click the name of a workload in the list to go to its details page.
-
On the workload details page, click Horizontal Pod Autoscaling.
-
On the Horizontal Pod Autoscaling page, click Create.
-
In the Create Horizontal Pod Autoscaling dialog box, set the autoscaling parameters for the workload, then click OK.
Parameter Description Target CPU Utilization
The target CPU utilization for all pod replicas in the workload, in percentage. When the actual CPU utilization is greater/less than the target value, the system automatically decreases/increases the number of pod replicas.
Target Memory Utilization
The target memory utilization for all pod replicas in the workload, in MiB. When the actual CPU utilization is greater/less than the target value, the system automatically decreases/increases the number of pod replicas.
Min Replicas
The minimum allowed number of pod replicas. The default value is 1.
Max Replicas
The maximum allowed number of pod replicas. The default value is 1.
After the setup is complete, the
icon will appear in the status bar on the Deployments or StatefulSets list page, indicating that a pod horizontal auto-scaling policy has been set.
-
On the Pod Horizontal Auto-scaling page, click the
icon to the right of the auto-scaling entry to edit or delete the auto-scaling settings.