Merge pull request #76 from elgnay/issue-13265

increase qps & burst
This commit is contained in:
OpenShift Merge Robot
2021-06-14 21:50:18 -04:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

1
go.sum
View File

@@ -555,7 +555,6 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=

View File

@@ -26,11 +26,16 @@ import (
type WorkloadAgentOptions struct {
HubKubeconfigFile string
SpokeClusterName string
QPS float32
Burst int
}
// NewWorkloadAgentOptions returns the flags with default value set
func NewWorkloadAgentOptions() *WorkloadAgentOptions {
return &WorkloadAgentOptions{}
return &WorkloadAgentOptions{
QPS: 50,
Burst: 100,
}
}
// AddFlags register and binds the default flags
@@ -39,6 +44,8 @@ func (o *WorkloadAgentOptions) AddFlags(cmd *cobra.Command) {
// This command only supports reading from config
flags.StringVar(&o.HubKubeconfigFile, "hub-kubeconfig", o.HubKubeconfigFile, "Location of kubeconfig file to connect to hub cluster.")
flags.StringVar(&o.SpokeClusterName, "spoke-cluster-name", o.SpokeClusterName, "Name of spoke cluster.")
flags.Float32Var(&o.QPS, "spoke-kube-api-qps", o.QPS, "QPS to use while talking with apiserver on spoke cluster.")
flags.IntVar(&o.Burst, "spoke-kube-api-burst", o.Burst, "Burst to use while talking with apiserver on spoke cluster.")
}
// RunWorkloadAgent starts the controllers on agent to process work from hub.
@@ -59,6 +66,8 @@ func (o *WorkloadAgentOptions) RunWorkloadAgent(ctx context.Context, controllerC
// Build dynamic client and informer for spoke cluster
spokeRestConfig := controllerContext.KubeConfig
spokeRestConfig.QPS = o.QPS
spokeRestConfig.Burst = o.Burst
spokeDynamicClient, err := dynamic.NewForConfig(spokeRestConfig)
if err != nil {
return err