From 9523e0fe8d23d47699df77da75a12e5f07569690 Mon Sep 17 00:00:00 2001 From: devincd <505259926@qq.com> Date: Tue, 2 Apr 2024 18:08:26 +0800 Subject: [PATCH] put qps and burst to cmd Signed-off-by: devincd <505259926@qq.com> --- cmd/kubemark/app/hollow_node.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/kubemark/app/hollow_node.go b/cmd/kubemark/app/hollow_node.go index 62de5839bc6..7385e3e98b5 100644 --- a/cmd/kubemark/app/hollow_node.go +++ b/cmd/kubemark/app/hollow_node.go @@ -63,6 +63,8 @@ type hollowNodeConfig struct { NodeName string ServerPort int ContentType string + QPS float32 + Burst int NodeLabels map[string]string RegisterWithTaints []v1.Taint MaxPods int @@ -94,6 +96,9 @@ func (c *hollowNodeConfig) addFlags(fs *pflag.FlagSet) { fs.IntVar(&c.ServerPort, "api-server-port", 443, "Port on which API server is listening.") fs.StringVar(&c.Morph, "morph", "", fmt.Sprintf("Specifies into which Hollow component this binary should morph. Allowed values: %v", knownMorphs.List())) fs.StringVar(&c.ContentType, "kube-api-content-type", "application/vnd.kubernetes.protobuf", "ContentType of requests sent to apiserver.") + fs.Float32Var(&c.QPS, "kube-api-qps", 10, "QPS indicates the maximum QPS to the apiserver.") + fs.IntVar(&c.Burst, "kube-api-burst", 20, "Burst indicates maximum burst for throttle to the apiserver.") + bindableNodeLabels := cliflag.ConfigurationMap(c.NodeLabels) fs.Var(&bindableNodeLabels, "node-labels", "Additional node labels") fs.Var(utilflag.RegisterWithTaintsVar{Value: &c.RegisterWithTaints}, "register-with-taints", "Register the node with the given list of taints (comma separated \"=:\"). No-op if register-node is false.") @@ -120,8 +125,8 @@ func (c *hollowNodeConfig) createClientConfigFromFile() (*restclient.Config, err return nil, fmt.Errorf("error while creating kubeconfig: %v", err) } config.ContentType = c.ContentType - config.QPS = 10 - config.Burst = 20 + config.QPS = c.QPS + config.Burst = c.Burst return config, nil }