Help Center/ Application Service Mesh/ FAQs/ Managing Traffic/ How Do I Change the Resource Requests of the istio-proxy Container?
Updated on 2024-01-24 GMT+08:00

How Do I Change the Resource Requests of the istio-proxy Container?

The default resources of the istio-proxy container are as follows. You can change the resources as required.

resources:
  limits:
    cpu: "2"
    memory: 512Mi
  requests:
    cpu: "1"
    memory: 512Mi

Method 1: Modify the Configuration for All Services in the Mesh

Do as follow to change the resource requests configuration of the istio-proxy container for all services in the mesh at a time:

  1. Run the following command to modify the ConfigMap:

    kubectl edit cm istio-sidecar-injector -n istio-system

  2. Restart the istio-sidecar-injector pod in the istio-system namespace.
  3. Restart service pods in the rolling upgrade mode to avoid service interruption.

Method 2: Modify the Configuration for A Specific Service in the Mesh

  1. Modify the YAML file of the service.

    kubectl edit deploy <nginx> -n <namespace>

  2. Add the following configuration lines to spec.template.metadata.annotations (you can change the resource size as required).

        sidecar.istio.io/proxyCPU: 500m
        sidecar.istio.io/proxyLimitCPU: 500m
        sidecar.istio.io/proxyLimitMemory: 1024Mi
        sidecar.istio.io/proxyMemory: 1024Mi

    For meshes of Istio 1.8, add the following configuration lines:

        sidecar.istio.io/proxyCPU: 500m
        sidecar.istio.io/proxyCPULimit: 500m
        sidecar.istio.io/proxyMemoryLimit: 1024Mi
        sidecar.istio.io/proxyMemory: 1024Mi

  3. After the modification, restart service pods in the rolling upgrade mode to avoid service interruption.