Updated on 2024-07-02 GMT+08:00

Updating an AS Configuration

Auto Scaling (AS) enables elastic scaling of nodes in a node pool based on scaling policies. Without this function, you have to manually adjust the number of nodes in a node pool.

Notes and Constraints

To enable AS, the CCE Cluster Autoscaler add-on must be installed in the target cluster.

Procedure

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Nodes. On the Node Pools tab, locate the row containing the target node pool and click Auto Scaling.

    • If Autoscaler has not been installed, configure add-on parameters based on service requirements, click Install, and wait until the add-on is installed. For details about add-on configurations, see CCE Cluster Autoscaler.
    • If Autoscaler has been installed, directly configure auto scaling policies.

  3. Configure auto scaling policies.

    AS Configuration

    • Customized Rule: Click Add Rule. In the dialog box displayed, configure parameters. You can add multiple node scaling policies, a maximum of one CPU usage-based rule, and one memory usage-based rule. The total number of rules cannot exceed 10.
      The following table lists custom rules.
      Table 1 Custom rules

      Rule Type

      Configuration

      Metric-based

      • Trigger: Select CPU allocation rate or Memory allocation rate and enter a value. The percentage must be greater than the value specified in the node resource requirements for a node scale-in when you configure a scaling policy (Configuring an Auto Scaling Policy for a Cluster).
        NOTE:
        • Resource allocation (%) = Resources requested by pods in the node pool/Resources allocatable to pods in the node pool
        • If multiple rules meet the conditions, the rules are executed in either of the following modes:

          If rules based on the CPU allocation rate and memory allocation rate are configured and two or more rules meet the scale-out conditions, the rule that will add the most nodes will be executed.

          If a rule is configured based on the CPU allocation rate and a periodic rule and both the rules meet the scale-out conditions, the periodic rule executed early changes the node pool to the scaling state. As a result, the metric-based rule cannot be executed. After the periodic rule is executed and the node pool status becomes normal, the metric-based rule will not be executed. If the metric-based rule is executed early, the periodic rule will be executed after the metric-based rule is executed.

        • If a rule is configured based on the CPU allocation rate and memory allocation rate, the policy detection period varies with the processing logic of each loop of the Autoscaler add-on. A scale-out is triggered once the conditions are met, but it is constrained by other factors such as the cooldown period and node pool status.
        • If the number of nodes reaches the upper limit of the cluster scale, the upper limit of the nodes supported in a node pool, or the upper limit of the nodes of a specific flavor, a metric-based scale-out will not be triggered.
        • If the number of nodes, CPUs, or memory resources reaches the upper limit for a node scale-out, a metric-based scale-out will not be triggered.
      • Action: Configure an action to be performed when the triggering condition is met.
        • Custom: Add a specified number of nodes to a node pool.
        • Auto calculation: When the trigger condition is met, nodes are automatically added and the allocation rate is restored to a value lower than the threshold. The formula is as follows:

          Number of nodes to be added = [Resource request of pods in the node pool/(Available resources of a single node x Target allocation rate)] – Number of current nodes + 1

      Periodic

      • Trigger Time: You can select a specific time every day, every week, every month, or every year.
      • Action: specifies an action to be carried out when the trigger time is reached. A specified number of nodes will be added to the node pool.
    • Nodes: The number of nodes in a node pool will always be within the range during auto scaling.
    • Cooldown Period: a period during which the nodes added in the current node pool cannot be scaled in.

    AS Object

    • Specifications: Configure whether to enable auto scaling for node flavors in a node pool.

      If multiple flavors are configured for a node pool, you can specify the upper limit for the number of nodes and the priority for each flavor separately.

  4. Click OK.