mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #16112 from deads2k/expose-resync
Auto commit by PR queue bot
This commit is contained in:
commit
6b330a8db5
@ -201,7 +201,7 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.IntVar(&s.KubeAPIBurst, "kube-api-burst", s.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
|
fs.IntVar(&s.KubeAPIBurst, "kube-api-burst", s.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CMServer) resyncPeriod() time.Duration {
|
func (s *CMServer) ResyncPeriod() time.Duration {
|
||||||
factor := rand.Float64() + 1
|
factor := rand.Float64() + 1
|
||||||
return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor)
|
return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor)
|
||||||
}
|
}
|
||||||
@ -247,14 +247,14 @@ func (s *CMServer) Run(_ []string) error {
|
|||||||
glog.Fatal(server.ListenAndServe())
|
glog.Fatal(server.ListenAndServe())
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go endpointcontroller.NewEndpointController(kubeClient, s.resyncPeriod).
|
go endpointcontroller.NewEndpointController(kubeClient, s.ResyncPeriod).
|
||||||
Run(s.ConcurrentEndpointSyncs, util.NeverStop)
|
Run(s.ConcurrentEndpointSyncs, util.NeverStop)
|
||||||
|
|
||||||
go replicationcontroller.NewReplicationManager(kubeClient, s.resyncPeriod, replicationcontroller.BurstReplicas).
|
go replicationcontroller.NewReplicationManager(kubeClient, s.ResyncPeriod, replicationcontroller.BurstReplicas).
|
||||||
Run(s.ConcurrentRCSyncs, util.NeverStop)
|
Run(s.ConcurrentRCSyncs, util.NeverStop)
|
||||||
|
|
||||||
if s.TerminatedPodGCThreshold > 0 {
|
if s.TerminatedPodGCThreshold > 0 {
|
||||||
go gc.New(kubeClient, s.resyncPeriod, s.TerminatedPodGCThreshold).
|
go gc.New(kubeClient, s.ResyncPeriod, s.TerminatedPodGCThreshold).
|
||||||
Run(util.NeverStop)
|
Run(util.NeverStop)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,13 +313,13 @@ func (s *CMServer) Run(_ []string) error {
|
|||||||
|
|
||||||
if containsResource(resources, "daemonsets") {
|
if containsResource(resources, "daemonsets") {
|
||||||
glog.Infof("Starting daemon set controller")
|
glog.Infof("Starting daemon set controller")
|
||||||
go daemon.NewDaemonSetsController(kubeClient, s.resyncPeriod).
|
go daemon.NewDaemonSetsController(kubeClient, s.ResyncPeriod).
|
||||||
Run(s.ConcurrentDSCSyncs, util.NeverStop)
|
Run(s.ConcurrentDSCSyncs, util.NeverStop)
|
||||||
}
|
}
|
||||||
|
|
||||||
if containsResource(resources, "jobs") {
|
if containsResource(resources, "jobs") {
|
||||||
glog.Infof("Starting job controller")
|
glog.Infof("Starting job controller")
|
||||||
go job.NewJobController(kubeClient, s.resyncPeriod).
|
go job.NewJobController(kubeClient, s.ResyncPeriod).
|
||||||
Run(s.ConcurrentJobSyncs, util.NeverStop)
|
Run(s.ConcurrentJobSyncs, util.NeverStop)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user