Check ID:
Provider: Kubernetes
Service:
Severity: HIGH
Categories:
Resource type:
controllermanager_garbage_collectionProvider: Kubernetes
Service:
controllermanagerSeverity: HIGH
Categories:
cluster-securityResource type:
PodWhat this check verifies
Kubernetes controller manager terminated Pod garbage collection threshold is evaluated. The finding highlights use of the default--terminated-pod-gc-threshold=12500 instead of a value tuned to cluster size and workload churn. The threshold controls when terminated Pods are automatically removed.
Risk
Retaining too many terminated Pods strains API server, etcd, and controller memory, reducing control-plane availability. Effects include slow list/watch operations, lagging schedulers, timeouts, and, in worst cases, controller crashes or admin-plane DoS.Recommendation
Set a lower, context-appropriate--terminated-pod-gc-threshold to match cluster scale and pod churn, preserving control-plane capacity. Monitor garbage collection and control-plane metrics and adjust proactively. Use ttlSecondsAfterFinished for Jobs to minimize terminated Pods.
Remediation
Dashboard steps- SSH to each control-plane node
- Edit the static Pod manifest: /etc/kubernetes/manifests/kube-controller-manager.yaml
- Under the kube-controller-manager container args/command, set: —terminated-pod-gc-threshold=10 (any value not equal to 12500)
- Save the file; the kubelet will automatically restart the controller-manager
- Repeat on all control-plane nodes if using HA
References
- https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-garbage-collection
- https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
Where this check fires
This check runs on every scheduled scan against your Kubernetes account. Findings appear at Cloud Security → Findings filterable byCheck ID = controllermanager_garbage_collection. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Kubernetes checks