Configure Horizontal Pod Autoscaler
Set up an HPA to automatically scale the number of Pods based on CPU or memory utilization.
Prerequisites
- The target Deployment must be running.
- Metrics Server must be deployed in the cluster.
Step 1. Open the Create HPA form
Select Service Discovery → Horizontal pod autoscalers from the left sidebar. Click the Create horizontal pod autoscaler button in the top right.
Step 2. Configure target and replica settings
| Field | Description | Example |
|---|---|---|
| Name | HPA name | my-app-hpa |
| Namespace | Target namespace | default |
| Target Kind | Resource type to scale | Deployment |
| Target Name | Name of the resource to scale | my-app |
| Min Replicas | Minimum number of Pods to maintain | 2 |
| Max Replicas | Maximum number of Pods allowed | 10 |
TIP
Set Min Replicas greater than 1 to ensure minimum availability.
Step 3. Configure scaling metrics
Click Add Metric to define the scaling criteria.
| Field | Description | Example |
|---|---|---|
| Metric Type | Type of metric | Resource |
| Resource | CPU or Memory | cpu |
| Target Type | Utilization (%) or AverageValue (absolute) | Utilization |
| Target Value | Threshold value | 70 (scale out when CPU exceeds 70%) |
Multiple metrics can be configured simultaneously. The HPA uses the metric that requires the most Pods to determine scaling.
Step 4. Confirm creation
Click Create. Check the created HPA in the Horizontal pod autoscalers list.
- Current / Min / Max: Current, minimum, and maximum replica counts
- Targets: Current utilization vs. target value
Pods automatically scale up when load exceeds the threshold, and scale down as load decreases.