Skip to content

Commit 44887d7

Browse files
authored
Merge pull request kosmos-io#780 from rxy0210/fix_qps_burst
fix: add proxy qps and burst
2 parents 7198f79 + 1a78ea9 commit 44887d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/clusterlink/proxy/app/options/options.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ import (
1818
logsapi "k8s.io/component-base/logs/api/v1"
1919

2020
"github.com/kosmos.io/kosmos/pkg/clusterlink/proxy"
21+
"github.com/kosmos.io/kosmos/pkg/utils"
2122
)
2223

2324
// Options contains command line parameters for clusterlink-proxy
2425
type Options struct {
2526
MaxRequestsInFlight int
2627
MaxMutatingRequestsInFlight int
28+
utils.KubernetesOptions
2729

2830
Logs *logs.Options
2931
SecureServing *genericoptions.SecureServingOptionsWithLoopback
@@ -97,7 +99,10 @@ func (o *Options) Flags() cliflag.NamedFlagSets {
9799
genericfs.IntVar(&o.MaxMutatingRequestsInFlight, "max-mutating-requests-inflight", o.MaxMutatingRequestsInFlight, ""+
98100
"this flag limits the maximum number of mutating requests in flight, or a zero value disables the limit completely.")
99101

100-
o.CoreAPI.AddFlags(fss.FlagSet("global"))
102+
globalcfs := fss.FlagSet("global")
103+
globalcfs.Float32Var(&o.KubernetesOptions.QPS, "kube-qps", utils.DefaultKubeQPS, "QPS to use while talking with kube-apiserver.")
104+
globalcfs.IntVar(&o.KubernetesOptions.Burst, "kube-burst", utils.DefaultKubeBurst, "Burst to use while talking with kube-apiserver.")
105+
o.CoreAPI.AddFlags(globalcfs)
101106
o.SecureServing.AddFlags(fss.FlagSet("secure serving"))
102107
o.Authentication.AddFlags(fss.FlagSet("authentication"))
103108
o.Authorization.AddFlags(fss.FlagSet("authorization"))
@@ -166,5 +171,7 @@ func (o *Options) genericOptionsApplyTo(config *genericapiserver.RecommendedConf
166171
if err := o.CoreAPI.ApplyTo(config); err != nil {
167172
return err
168173
}
174+
175+
utils.SetQPSBurst(config.ClientConfig, o.KubernetesOptions)
169176
return o.Admission.ApplyTo(&config.Config, config.SharedInformerFactory, config.ClientConfig, o.FeatureGate)
170177
}

0 commit comments

Comments
 (0)