Updated on 2024-09-24 GMT+08:00

Container Resource Requests and Limits

  1. Log in to the CCE Console console and click the cluster name to access the cluster console. In the navigation pane, choose Workloads. Then, locate the workload you want to upgrade and choose More > Edit YAML in the Operation column.
  2. Configure the following parameters in YAML:

    spec:
      template: 
    spec:
          containers:
            - name: istio-proxy
              resources:
                limits:
                  cpu: '2'
                  memory: 4Gi
                requests:
                  cpu: '2'
                  memory: 4Gi

    You can also click Upgrade in the Operation column of the workload to configure the parameters.

    Recommended value description:

    • The gateway is sensitive to CPU. The recommended ratio of Request to Limit is 1:1. If the value of Request is too small and the value of Limit is too large, node resources are overcommitted.
    • 2 vCPUs and 4 GiB of memory are only for reference. Adjust the values based on the pressure test result.

    CPU quota parameters

    Parameter

    Description

    Request

    Minimum number of CPU cores required by a container. Resources are scheduled for the container based on this value. The container can be scheduled to a node only when the total available CPU on the node is greater than or equal to the requested number of CPU cores.

    Limit

    Maximum number of CPU cores available for a container.

    Memory quota parameters

    Parameter

    Description

    Request

    Minimum amount of memory required by a container. Resources are scheduled for the container based on this value. The container can be scheduled to a node only when the total available memory on the node is greater than or equal to the requested memory.

    Limit

    Maximum amount of memory available for a container. When the memory usage exceeds the specified memory limit, the instance may restart, which affects the normal use of the workload.

Configuring container resource requests and limits will trigger a workload rolling upgrade. This means pods restart immediately.