Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff57f58

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #35476 from foxish/always-run-pod-gc
Automatic merge from submit-queue Always run the podGC controller. **What this PR does / why we need it**: The podGC controller has evolved to do more than just GC of terminated pods beyond a threshold number. It no longer makes sense to gate running it with the `terminated-pod-gc-threshold` flag. [We still ensure that it only runs the terminatedPodsGC if the threshold specified in the argument to the controller manager is > 0](https://github.com/kubernetes/kubernetes/blob/6079053407705212c8cc3f039e8b767c6bccd0a0/pkg/controller/podgc/gc_controller.go#L124). Related discussion: #34160 (comment) **Release note**: ```release-note The podGC controller will now always run, irrespective of the value supplied to the "terminated-pod-gc-threshold" flag supplied to the controller manager. The specific behavior of the podGC controller to clean up terminated pods is still governed by the flag, but the podGC's responsibilities have evolved beyond just cleaning up terminated pods. ```
2 parents e7c37f6 + b5d9f2f commit ff57f58

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

cmd/kube-controller-manager/app/controllermanager.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,9 @@ func StartControllers(s *options.CMServer, kubeconfig *restclient.Config, rootCl
271271
).Run(int(s.ConcurrentRCSyncs), wait.NeverStop)
272272
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
273273

274-
if s.TerminatedPodGCThreshold > 0 {
275-
go podgc.NewPodGC(client("pod-garbage-collector"), sharedInformers.Pods().Informer(),
276-
int(s.TerminatedPodGCThreshold)).Run(wait.NeverStop)
277-
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
278-
}
274+
go podgc.NewPodGC(client("pod-garbage-collector"), sharedInformers.Pods().Informer(),
275+
int(s.TerminatedPodGCThreshold)).Run(wait.NeverStop)
276+
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
279277

280278
cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile)
281279
if err != nil {

0 commit comments

Comments
 (0)