The ack-slo-manager component provides the elastic resource limit feature. You can use this feature to limit the CPU usage of BestEffort (BE) pods on a node. This ensures the stability of the containers on the node. This topic describes how to use the elastic resource limit feature that is provided by ack-slo-manager.

Prerequisites

ack-slo-manager 0.4.0 or later is installed. For more information about how to install ack-slo-manager, see Usage notes.
Note ack-slo-manager is upgraded and optimized based on resource-controller. You must uninstall resource-controller after you install ack-slo-manager. For more information about how to uninstall a component, see Manage system components.

Background information

In the Dynamic resource overcommitment model that is provided by ack-slo-manager, the total amount of reclaimed resources dynamically changes based on the actual amount of resources used by latency-sensitive (LS) pods. Reclaimed resources can be used by BE pods. You can use the dynamic resource overcommitment feature to improve the resource utilization of a cluster by deploying both LS pods and BE pods in the cluster. To ensure sufficient CPU resources for the LS pods on a node, you can use ack-slo-manager to limit the CPU usage of the BE pods on the node. The elastic resource limit feature can maintain the resource utilization of a node below a specified threshold and limit the amount of CPU resources that can be used by BE pods. This ensures the stability of the containers on the node.

CPU Threshold indicates the CPU utilization threshold of a node. Pod (LS).Usage indicates the CPU usage of LS pods. CPU Restriction for BE indicates the CPU usage of BE pods. The amount of CPU resources that can be used by BE pods is adjusted based on the increase or decrease of the CPU usage of LS pods. We recommend that you use the same value for CPU Threshold and the reserved CPU watermark in the dynamic resource overcommitment model. This ensures a consistent level of CPU resource utilization. Elastic resource limit

Procedure

  1. Create a configmap.yaml file based on the following ConfigMap content:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ack-slo-manager-config
      namespace: kube-system
    data:
      # Enable the elastic resource limit feature. 
      resource-threshold-config: |
        {
          "clusterStrategy": {
            "enable": true   
          }
        }
  2. Run the following command to update the ConfigMap.

    To avoid changing other settings in the ConfigMap, we commend that you run the kubectl patch command to update the ConfigMap.

    kubectl patch cm -n kube-system ack-slo-manager-config --patch "$(cat configmap.yaml)"
  3. Run the following command to query the CPU cores that are allocated to the BE pods on the node:
    cat /sys/fs/cgroup/cpuset/kubepods.slice/kubepods-besteffort.slice/cpuset.cpus

    Expected output:

    10-25,35-51,62-77,87-103

    The output shows that the following CPU cores are allocated to the BE pods on the node: 10-25, 35-51, 62-77, and 87-103.

  4. Optional:Configure advanced parameters based on the following ConfigMap content.

    The elastic resource limit feature allows you to configure the CPU utilization threshold in a fine-grained manner.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ack-slo-manager-config
      namespace: kube-system
    data:
      resource-threshold-config: |
        {
          "clusterStrategy": {
            "enable": true,
            "cpuSuppressThresholdPercent": 65
          }
        }
    The following table describes the parameters.
    Parameter Data type Valid value Description
    enable Boolean
    • true
    • flase
    • true: enables the elastic resource limit feature.
    • false: disables the elastic resource limit feature.
    cpuSuppressThresholdPercent Int 0~100 The CPU utilization threshold of the node. Unit: %. Default value: 65.
Note ack-slo-manager is compatible with resource-controller. We recommend that you use ack-slo-manager to configure the elastic resource limit feature. To use resource-controller to configure the elastic resource limit feature, Submit a ticket.