@@ -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,9 @@ 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+ // Disable client-side ratelimer by default, we can rely on
109+ // API priority and fairness
110+ cfg .QPS = - 1
106111 }
107112 return cfg , nil
108113}
@@ -170,6 +175,9 @@ func loadConfigWithContext(apiServerURL string, loader clientcmd.ClientConfigLoa
170175// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
171176// in cluster and use the cluster provided kubeconfig.
172177//
178+ // The returned `*rest.Config` has client-side ratelimting disabled as we can rely on API priority and
179+ // fairness. Set its QPS to a value equal or bigger than 0 to re-enable it.
180+ //
173181// Will log an error and exit if there is an error creating the rest.Config.
174182func GetConfigOrDie () * rest.Config {
175183 config , err := GetConfig ()
0 commit comments