mirror of https://github.com/k3s-io/k3s
Merge pull request #28340 from ZTE-PaaS/zhangke-patch-007
Automatic merge from submit-queue controller-manager support number of garbage collector workers to be configurable The number of garbage collector workers of controller-manager is a fixed value 5 now, make it configurable should more properlypull/6/head
commit
b50e66c66e
|
@ -466,7 +466,7 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
|
|||
glog.Errorf("Failed to start the generic garbage collector")
|
||||
} else {
|
||||
// TODO: make this a flag of kube-controller-manager
|
||||
workers := 5
|
||||
workers := int(s.ConcurrentGCSyncs)
|
||||
go garbageCollector.Run(workers, wait.NeverStop)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ func NewCMServer() *CMServer {
|
|||
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
||||
ControllerStartInterval: unversioned.Duration{Duration: 0 * time.Second},
|
||||
EnableGarbageCollector: false,
|
||||
ConcurrentGCSyncs: 5,
|
||||
},
|
||||
}
|
||||
return &s
|
||||
|
@ -163,5 +164,6 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.Int32Var(&s.KubeAPIBurst, "kube-api-burst", s.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
|
||||
fs.DurationVar(&s.ControllerStartInterval.Duration, "controller-start-interval", s.ControllerStartInterval.Duration, "Interval between starting controller managers.")
|
||||
fs.BoolVar(&s.EnableGarbageCollector, "enable-garbage-collector", s.EnableGarbageCollector, "Enables the generic garbage collector. MUST be synced with the corresponding flag of the kube-apiserver. WARNING: the generic garbage collector is an alpha feature.")
|
||||
fs.Int32Var(&s.ConcurrentGCSyncs, "concurrent-gc-syncs", s.ConcurrentGCSyncs, "The number of garbage collector workers that are allowed to sync concurrently.")
|
||||
leaderelection.BindFlags(&s.LeaderElection, fs)
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ concurrent-replicaset-syncs
|
|||
concurrent-service-syncs
|
||||
concurrent-resource-quota-syncs
|
||||
concurrent-serviceaccount-token-syncs
|
||||
concurrent-gc-syncs
|
||||
config-sync-period
|
||||
configure-cbr0
|
||||
configure-cloud-routes
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -570,6 +570,9 @@ type KubeControllerManagerConfiguration struct {
|
|||
// corresponding flag of the kube-apiserver. WARNING: the generic garbage
|
||||
// collector is an alpha feature.
|
||||
EnableGarbageCollector bool `json:"enableGarbageCollector"`
|
||||
// concurrentGCSyncs is the number of garbage collector workers that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentGCSyncs int32 `json:"concurrentGCSyncs"`
|
||||
}
|
||||
|
||||
// VolumeConfiguration contains *all* enumerated flags meant to configure all volume
|
||||
|
|
Loading…
Reference in New Issue