Skip to main content

More Info:

Activate garbage collector on pod termination, as appropriate

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the current manifest so you can roll back if needed:
  2. On every control plane node, open the manifest for editing:
  3. In the spec.containers[0].command or spec.containers[0].args list, add or modify the terminated pod GC flag to the threshold you decide is appropriate for your cluster (example: 10). For example, ensure there is a line similar to:
    Place it alongside the other -- flags for kube-controller-manager. Save and exit.
    Note: Editing this static pod manifest will cause the kube-controller-manager pod to restart automatically.
  4. (Optional sanity check) Immediately after saving, confirm the static pod has been recreated and is running:
    (Use whichever container runtime CLI is available on your node.)
  5. On every control plane node, verify that the running process now includes the configured threshold value:
    Confirm the output shows --terminated-pod-gc-threshold=10 (or your chosen value).
kubectl cannot modify the kube-controller-manager static pod manifest or its process flags, so this setting cannot be fixed through the Kubernetes API. To remediate, you must edit /etc/kubernetes/manifests/kube-controller-manager.yaml directly on every control plane node; follow the instructions in the Manual Steps section.

Additional Reading: