@@ -61,6 +61,9 @@ func RegisterFlags(fs *flag.FlagSet) {
61
61
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
62
62
// in cluster and use the cluster provided kubeconfig.
63
63
//
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
+ //
64
67
// It also applies saner defaults for QPS and burst based on the Kubernetes
65
68
// controller manager defaults (20 QPS, 30 burst)
66
69
//
@@ -81,6 +84,9 @@ func GetConfig() (*rest.Config, error) {
81
84
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
82
85
// in cluster and use the cluster provided kubeconfig.
83
86
//
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
+ //
84
90
// It also applies saner defaults for QPS and burst based on the Kubernetes
85
91
// controller manager defaults (20 QPS, 30 burst)
86
92
//
@@ -99,10 +105,9 @@ func GetConfigWithContext(context string) (*rest.Config, error) {
99
105
return nil , err
100
106
}
101
107
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
106
111
}
107
112
return cfg , nil
108
113
}
@@ -170,6 +175,9 @@ func loadConfigWithContext(apiServerURL string, loader clientcmd.ClientConfigLoa
170
175
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
171
176
// in cluster and use the cluster provided kubeconfig.
172
177
//
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
+ //
173
181
// Will log an error and exit if there is an error creating the rest.Config.
174
182
func GetConfigOrDie () * rest.Config {
175
183
config , err := GetConfig ()
0 commit comments