mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
controller-manager support number of garbage collector workers to be configurable
This commit is contained in:
parent
61a9358dbd
commit
d74010211a
@ -468,7 +468,7 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
|
|||||||
glog.Errorf("Failed to start the generic garbage collector")
|
glog.Errorf("Failed to start the generic garbage collector")
|
||||||
} else {
|
} else {
|
||||||
// TODO: make this a flag of kube-controller-manager
|
// TODO: make this a flag of kube-controller-manager
|
||||||
workers := 5
|
workers := int(s.ConcurrentGCSyncs)
|
||||||
go garbageCollector.Run(workers, wait.NeverStop)
|
go garbageCollector.Run(workers, wait.NeverStop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ func NewCMServer() *CMServer {
|
|||||||
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
||||||
ControllerStartInterval: unversioned.Duration{Duration: 0 * time.Second},
|
ControllerStartInterval: unversioned.Duration{Duration: 0 * time.Second},
|
||||||
EnableGarbageCollector: false,
|
EnableGarbageCollector: false,
|
||||||
|
ConcurrentGCSyncs: 5,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return &s
|
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.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.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.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)
|
leaderelection.BindFlags(&s.LeaderElection, fs)
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@ concurrent-replicaset-syncs
|
|||||||
concurrent-service-syncs
|
concurrent-service-syncs
|
||||||
concurrent-resource-quota-syncs
|
concurrent-resource-quota-syncs
|
||||||
concurrent-serviceaccount-token-syncs
|
concurrent-serviceaccount-token-syncs
|
||||||
|
concurrent-gc-syncs
|
||||||
config-sync-period
|
config-sync-period
|
||||||
configure-cbr0
|
configure-cbr0
|
||||||
configure-cloud-routes
|
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
|
// corresponding flag of the kube-apiserver. WARNING: the generic garbage
|
||||||
// collector is an alpha feature.
|
// collector is an alpha feature.
|
||||||
EnableGarbageCollector bool `json:"enableGarbageCollector"`
|
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
|
// VolumeConfiguration contains *all* enumerated flags meant to configure all volume
|
||||||
|
Loading…
Reference in New Issue
Block a user