Updated on 2025-01-03 GMT+08:00

Managing Workload Scaling Policies

Viewing an HPA Policy

You can view the rules, status, and events of an HPA policy and handle exceptions based on the error information displayed.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane on the left, choose Policies. On the HPA Policies tab, locate the HPA policy you want to view and click next to the policy.
  3. In the expanded area, choose View Events in the Operation column. If the policy malfunctions, locate and rectify the fault based on the error message displayed on the page.

    You can also view an HPA policy on the workload details page.

    1. Log in to the CCE console and click the cluster name to access the cluster console.
    2. In the navigation pane on the left, choose Workloads. Click the workload name to view its details.
    3. On the workload details page, switch to the Policies tab to view the HPA policy. You can also view the policies you configured in Workload Scaling.
    Table 1 Event types and names

    Event Type

    Event Name

    Description

    Normal

    SuccessfulRescale

    The scaling is performed successfully.

    Abnormal

    InvalidTargetRange

    Invalid target range.

    InvalidSelector

    Invalid selector.

    FailedGetObjectMetric

    Objects fail to be obtained.

    FailedGetPodsMetric

    Pods fail to be obtained.

    FailedGetResourceMetric

    Resources fail to be obtained.

    FailedGetExternalMetric

    External metrics fail to be obtained.

    InvalidMetricSourceType

    Invalid metric source type.

    FailedConvertHPA

    HPA conversion failed.

    FailedGetScale

    The scale fails to be obtained.

    FailedComputeMetricsReplicas

    Failed to calculate metric-defined replicas.

    FailedGetScaleWindow

    Failed to obtain ScaleWindow.

    FailedRescale

    Failed to scale the workload.

Editing an HPA Policy on the Console

To edit an HPA policy on the console, take the following steps:

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane on the left, choose Policies. On the HPA Policies tab, locate the HPA policy you want to edit and choose More > Edit in the Operation column.
  3. On the Edit HPA Policy page, modify the parameter settings based on Table 1.
  4. Click OK.

Editing an HPA Policy Using YAML

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane on the left, choose Policies. On the HPA Policies tab, locate the HPA policy you want to edit and click Edit YAML in the Operation column.
  3. In the Edit YAML dialog box displayed, edit or download the YAML file.

Cloning an HPA Policy

Copy the configuration of an existing HPA policy to create a new one, and associate it with a different namespace or workload.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane on the left, choose Policies. On the HPA Policies tab, locate the HPA policy you want to edit and choose More > Clone in the Operation column.
  3. On the Create HPA Policy page, set basic policy information by referring to 3.
  4. Click OK.

Deleting an HPA Policy

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane on the left, choose Policies. On the HPA Policies tab, locate the HPA policy you want to edit and choose More > Delete in the Operation column.
  3. In the dialog box displayed, click Yes.