diff --git a/cmd/controller-manager/app/controller-manager.go b/cmd/controller-manager/app/controller-manager.go index f28c4c3764..ab028989a2 100644 --- a/cmd/controller-manager/app/controller-manager.go +++ b/cmd/controller-manager/app/controller-manager.go @@ -64,6 +64,8 @@ const ( var ( kubeconfig, kubeFedConfig, masterURL, metricsAddr, healthzAddr string + restConfigQPS float32 + restConfigBurst int ) // NewControllerManagerCommand creates a *cobra.Command object with default parameters @@ -98,6 +100,8 @@ member clusters and do the necessary reconciliation`, flags.StringVar(&kubeFedConfig, "kubefed-config", "", "Path to a KubeFedConfig yaml file. Test only.") flags.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.") flags.StringVar(&masterURL, "master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.") + flags.Float32Var(&restConfigQPS, "rest-config-qps", 5.0, "Maximum QPS to the api-server from this client.") + flags.IntVar(&restConfigBurst, "rest-config-burst", 10, "Maximum burst for throttle to the api-server from this client.") local := flag.NewFlagSet(os.Args[0], flag.ExitOnError) klog.InitFlags(local) @@ -121,6 +125,12 @@ func Run(opts *options.Options, stopChan <-chan struct{}) error { if err != nil { panic(err) } + if restConfigQPS > 0 { + opts.Config.KubeConfig.QPS = restConfigQPS + } + if restConfigBurst > 0 { + opts.Config.KubeConfig.Burst = restConfigBurst + } runningInCluster := len(masterURL) == 0 && len(kubeconfig) == 0 if runningInCluster && len(opts.Config.KubeFedNamespace) == 0 { diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh index dcf63033ce..dfc6fd390e 100755 --- a/scripts/pre-commit.sh +++ b/scripts/pre-commit.sh @@ -31,7 +31,7 @@ PLATFORM="${OS}-${ARCH}" NUM_CLUSTERS="${NUM_CLUSTERS:-2}" JOIN_CLUSTERS="${JOIN_CLUSTERS:-}" DOWNLOAD_BINARIES="${DOWNLOAD_BINARIES:-}" -COMMON_TEST_ARGS="-kubeconfig=${HOME}/.kube/config -ginkgo.v -single-call-timeout=1m -ginkgo.trace -ginkgo.randomizeAllSpecs" +COMMON_TEST_ARGS="-kubeconfig=${HOME}/.kube/config -ginkgo.v -single-call-timeout=2m -ginkgo.trace -ginkgo.randomizeAllSpecs" E2E_TEST_CMD="${TEMP_DIR}/e2e-${PLATFORM} ${COMMON_TEST_ARGS}" # Disable limited scope in-memory controllers to ensure the controllers in the # race detection test behave consistently with deployed controllers for a