@@ -61,6 +61,9 @@ func RegisterFlags(fs *flag.FlagSet) {
6161// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
6262// in cluster and use the cluster provided kubeconfig.
6363//
64+ // The returned `*rest.Config` has client-side ratelimting disabled as we can rely on API priority and
65+ // fairness. Set its QPS to a value equal or bigger than 0 to re-enable it.
66+ //
6467// It also applies saner defaults for QPS and burst based on the Kubernetes
6568// controller manager defaults (20 QPS, 30 burst)
6669//
@@ -81,6 +84,9 @@ func GetConfig() (*rest.Config, error) {
8184// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
8285// in cluster and use the cluster provided kubeconfig.
8386//
87+ // The returned `*rest.Config` has client-side ratelimting disabled as we can rely on API priority and
88+ // fairness. Set its QPS to a value equal or bigger than 0 to re-enable it.
89+ //
8490// It also applies saner defaults for QPS and burst based on the Kubernetes
8591// controller manager defaults (20 QPS, 30 burst)
8692//
@@ -99,10 +105,7 @@ func GetConfigWithContext(context string) (*rest.Config, error) {
99105 return nil , err
100106 }
101107 if cfg .QPS == 0.0 {
102- cfg .QPS = 20.0
103- }
104- if cfg .Burst == 0 {
105- cfg .Burst = 30
108+ cfg .QPS = - 1
106109 }
107110 return cfg , nil
108111}
@@ -170,6 +173,9 @@ func loadConfigWithContext(apiServerURL string, loader clientcmd.ClientConfigLoa
170173// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
171174// in cluster and use the cluster provided kubeconfig.
172175//
176+ // The returned `*rest.Config` has client-side ratelimting disabled as we can rely on API priority and
177+ // fairness. Set its QPS to a value equal or bigger than 0 to re-enable it.
178+ //
173179// Will log an error and exit if there is an error creating the rest.Config.
174180func GetConfigOrDie () * rest.Config {
175181 config , err := GetConfig ()
0 commit comments