Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable response compression for k8s restAPI in client-go #3866

Merged
merged 9 commits into from
Nov 21, 2022
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ func main() {
var probeAddr string
var adapterClientRequestQPS float32
var adapterClientRequestBurst int
var disableCompression bool
pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
pflag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
pflag.Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
pflag.IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
pflag.BoolVar(&disableCompression, "disable-compression", false, "Disable response compression for k8s restAPI in client-go. ")
opts := zap.Options{}
opts.BindFlags(flag.CommandLine)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
Expand Down Expand Up @@ -110,6 +112,7 @@ func main() {
cfg := ctrl.GetConfigOrDie()
cfg.QPS = adapterClientRequestQPS
cfg.Burst = adapterClientRequestBurst
cfg.DisableCompression = disableCompression

mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
Expand Down