Skip to content

shutdown-manager does not have default limit #7550

Open

Description

@woodgear

it been complain by some scaner.
We could add a deployment patch in each EnvoyProxy, but I think it’s also quite reasonable to set a default instead. The shutdown-manager should never consume much memory or CPU. setting a limit of 1 core and 1 GB should be sufficient.

Activity

  1. changed the title [-]shutdown-manager does not have default limit and complain[/-] [+]shutdown-manager does not have default limit[/+] on Nov 18, 2025
  2. woodgear commented on Nov 18, 2025

    @woodgear
    ContributorAuthor

    @zhaohuabing should treat it as same as envoygateway? but we could not set shutdownmanager limit easyliy

  3. zhaohuabing commented on Nov 19, 2025

    @zhaohuabing
    Member

    Yeah, I think it makes sense. cc @envoyproxy/gateway-maintainers

  4. added
    help wanted
    and removed on Nov 19, 2025
  5. arkodg commented on Nov 19, 2025

    @arkodg
    Contributor

    A memory limit makes sense, we don't add CPU limits to avoid throttling

  6. tbosnjak commented on Dec 3, 2025

    @tbosnjak

    Hi @arkodg,

    can you please add some way of configuring this? We have some clusters that are running with OPA-enforced policies and we need the possibility to configure it.
    At the moment, we have managed to get a cluster to test and evaluate the implementation, and it works nicely when we suspend the policy. We successfully managed to configure all other containers, except the shutdown-manager.

  7. jukie commented on Dec 3, 2025

    @jukie
    Contributor

    @tbosnjak You can add cpu limits and adjust container resources with an EnvoyProxy similar to below:

    apiVersion: gateway.envoyproxy.io/v1alpha1
    kind: EnvoyProxy
    metadata:
      name: proxy-cfg
    spec:
      provider:
        kubernetes:
          envoyDeployment:
            patch:
              type: StrategicMerge
              value:
                spec:
                  template:
                    spec:
                      containers:
                        - name: shutdown-manager
                          resources:
                            limits:
                              cpu: 100m
                              memory: 1024Mi
                            requests:
                              cpu: 100m
                              memory: 1024Mi
    
  8. tbosnjak commented on Dec 3, 2025

    @tbosnjak

    @jukie , mate you rock! Thank you very much. I just tested it and it works.

    I just added your settings to my existing config.

    apiVersion: gateway.networking.k8s.io/v1
    kind: GatewayClass
    metadata:
      name: envoy
    spec:
      controllerName: gateway.envoyproxy.io/gatewayclass-controller
      parametersRef:
        group: gateway.envoyproxy.io
        kind: EnvoyProxy
        name: config
        namespace: cds-gateway-envoy
    ---
    apiVersion: gateway.envoyproxy.io/v1alpha1
    kind: EnvoyProxy
    metadata:
      name: config
      namespace: cds-gateway-envoy
    spec:
      provider:
        type: Kubernetes
        kubernetes:
          envoyDeployment:
            patch:
              type: StrategicMerge
              value:
                spec:
                  template:
                    spec:
                      containers:
                        - name: shutdown-manager
                          resources:
                            limits:
                              cpu: 100m
                              memory: 1024Mi
                            requests:
                              cpu: 100m
                              memory: 1024Mi
            replicas: 1
            container:
              image: <ACR_NAME>.azurecr.io/envoyproxy/envoy:distroless-v1.36.2
              resources:
                requests:
                  cpu: 150m
                  memory: 640Mi
                limits:
                  cpu: 500m
                  memory: 1Gi
            pod:
              tolerations:
                - key: CriticalAddonsOnly
                  operator: Exists
              nodeSelector:
                node.cds.team/purpose: cds-critical-addons
          envoyService:
            annotations:
              service.beta.kubernetes.io/azure-load-balancer-internal: "true"
              service.beta.kubernetes.io/azure-load-balancer-internal-subnet: <SUBNET_NAME>
            type: LoadBalancer
    
    
  9. nemobis commented on Apr 30, 2026

    @nemobis

    Configuring limits is also necessary if you are interested in having your envoy pods running as Guaranteed class, as that requires all containers to have CPU/memory requests/limits.

  10. meezaan commented on Nov 19, 2026

    @meezaan

    We see the same in v1.10.0. The shutdown-manager container is created with DefaultShutdownManagerContainerResourceRequirements() (internal/infrastructure/kubernetes/proxy/resource.go:211), which sets requests only (api/v1alpha1/envoyproxy_helpers.go:176-183). EnvoyGateway.provider.kubernetes.shutdownManager accepts only image (api/v1alpha1/envoygateway_types.go:1180-1183), and the EnvoyProxy container settings apply to the envoy container only.

    The effect for operators who run policy checks: the proxy Deployment, and the ReplicaSet template, show a container without CPU or memory limits. Checks such as trivy KSV-0011 and KSV-0018, and admission policies that require limits, fail on every proxy. A namespace LimitRange gives the running Pods limits, but those checks read the template. Patching the Deployment through EnvoyProxy is the only way to set the limits today, and some operators disable patches (runtime flag EnvoyProxyPatch) for security reasons.

    A resources field for the shutdown manager would solve it: in EnvoyGateway.provider.kubernetes.shutdownManager (cluster-wide), as #7550 suggests, or in EnvoyProxy, as #7770 suggests. Either works for us. We can test a change on kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions