Expose kube-api burst/qps settings for kube components

Default to hardcodes for components that had them, and 5.0 qps, 10 burst
for those that relied on client defaults

Unclear if maybe it'd be better to just assume these are set as part of
the incoming kubeconfig.  For now just exposing them as flags since it's
easier for me to manually tweak.
This commit is contained in:
Aaron Crickenberger
2015-10-12 11:56:15 -04:00
parent 139f5cd9ee
commit 69351e3e88
5 changed files with 50 additions and 8 deletions

View File

@@ -56,6 +56,8 @@ type SchedulerServer struct {
Kubeconfig string
BindPodsQPS float32
BindPodsBurst int
KubeApiQps float32
KubeApiBurst int
}
// NewSchedulerServer creates a new SchedulerServer with default parameters
@@ -64,6 +66,10 @@ func NewSchedulerServer() *SchedulerServer {
Port: ports.SchedulerPort,
Address: net.ParseIP("127.0.0.1"),
AlgorithmProvider: factory.DefaultProvider,
BindPodsQPS: 50.0,
BindPodsBurst: 100,
KubeApiQps: 50.0,
KubeApiBurst: 100,
}
return &s
}
@@ -77,8 +83,10 @@ func (s *SchedulerServer) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&s.EnableProfiling, "profiling", true, "Enable profiling via web interface host:port/debug/pprof/")
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig)")
fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.")
fs.Float32Var(&s.BindPodsQPS, "bind-pods-qps", 50.0, "Number of bindings per second scheduler is allowed to continuously make")
fs.IntVar(&s.BindPodsBurst, "bind-pods-burst", 100, "Number of bindings per second scheduler is allowed to make during bursts")
fs.Float32Var(&s.BindPodsQPS, "bind-pods-qps", s.BindPodsQPS, "Number of bindings per second scheduler is allowed to continuously make")
fs.IntVar(&s.BindPodsBurst, "bind-pods-burst", s.BindPodsBurst, "Number of bindings per second scheduler is allowed to make during bursts")
fs.Float32Var(&s.KubeApiQps, "kube-api-qps", s.KubeApiQps, "QPS to use while talking with kubernetes apiserver")
fs.IntVar(&s.KubeApiBurst, "kube-api-burst", s.KubeApiBurst, "Burst to use while talking with kubernetes apiserver")
}
// Run runs the specified SchedulerServer. This should never exit.
@@ -95,8 +103,10 @@ func (s *SchedulerServer) Run(_ []string) error {
if err != nil {
return err
}
kubeconfig.QPS = 50.0
kubeconfig.Burst = 100
// Override kubeconfig qps/burst settings from flags
kubeconfig.QPS = s.KubeApiQps
kubeconfig.Burst = s.KubeApiBurst
kubeClient, err := client.New(kubeconfig)
if err != nil {