@@ -18,12 +18,14 @@ import (
18
18
logsapi "k8s.io/component-base/logs/api/v1"
19
19
20
20
"github.com/kosmos.io/kosmos/pkg/clusterlink/proxy"
21
+ "github.com/kosmos.io/kosmos/pkg/utils"
21
22
)
22
23
23
24
// Options contains command line parameters for clusterlink-proxy
24
25
type Options struct {
25
26
MaxRequestsInFlight int
26
27
MaxMutatingRequestsInFlight int
28
+ utils.KubernetesOptions
27
29
28
30
Logs * logs.Options
29
31
SecureServing * genericoptions.SecureServingOptionsWithLoopback
@@ -97,7 +99,10 @@ func (o *Options) Flags() cliflag.NamedFlagSets {
97
99
genericfs .IntVar (& o .MaxMutatingRequestsInFlight , "max-mutating-requests-inflight" , o .MaxMutatingRequestsInFlight , "" +
98
100
"this flag limits the maximum number of mutating requests in flight, or a zero value disables the limit completely." )
99
101
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 )
101
106
o .SecureServing .AddFlags (fss .FlagSet ("secure serving" ))
102
107
o .Authentication .AddFlags (fss .FlagSet ("authentication" ))
103
108
o .Authorization .AddFlags (fss .FlagSet ("authorization" ))
@@ -166,5 +171,7 @@ func (o *Options) genericOptionsApplyTo(config *genericapiserver.RecommendedConf
166
171
if err := o .CoreAPI .ApplyTo (config ); err != nil {
167
172
return err
168
173
}
174
+
175
+ utils .SetQPSBurst (config .ClientConfig , o .KubernetesOptions )
169
176
return o .Admission .ApplyTo (& config .Config , config .SharedInformerFactory , config .ClientConfig , o .FeatureGate )
170
177
}
0 commit comments