Skip to content

Commit

Permalink
Merge pull request #197 from hhyasdf/release/0.4.1
Browse files Browse the repository at this point in the history
[RELEASE cherry-pick] adjust-client-qps-and-burst
  • Loading branch information
mars1024 authored Mar 11, 2022
2 parents a2abe3a + c532d0d commit a60f889
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ func init() {
func main() {
var (
controllerConcurrency map[string]int
clientQPS float32
clientBurst int
metricsPort int
)

// register flags
pflag.StringToIntVar(&controllerConcurrency, "controller-concurrency", map[string]int{}, "The specified concurrency of different controllers.")
pflag.Float32Var(&clientQPS, "kube-client-qps", 300, "The QPS limit of apiserver client.")
pflag.IntVar(&clientBurst, "kube-client-burst", 600, "The Burst limit of apiserver client.")
pflag.IntVar(&metricsPort, "metrics-port", 9899, "The port to listen on for prometheus metrics.")

// parse flags
Expand All @@ -69,11 +73,18 @@ func main() {
ctrllog.SetLogger(zapinit.NewZapLogger())

var entryLog = ctrllog.Log.WithName("entry")
entryLog.Info("starting hybridnet manager", "known-features", feature.KnownFeatures(), "commit-id", gitCommit)
entryLog.Info("starting hybridnet manager",
"known-features", feature.KnownFeatures(),
"commit-id", gitCommit,
"controller-concurrency", controllerConcurrency)

signalContext := ctrl.SetupSignalHandler()

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
clientConfig := ctrl.GetConfigOrDie()
clientConfig.QPS = clientQPS
clientConfig.Burst = clientBurst

mgr, err := ctrl.NewManager(clientConfig, ctrl.Options{
Scheme: scheme,
Logger: ctrl.Log.WithName("manager"),
MetricsBindAddress: fmt.Sprintf(":%d", metricsPort),
Expand Down

0 comments on commit a60f889

Please sign in to comment.