From b8522f68ee0a8ebb3652feeb9909dd9576af9a03 Mon Sep 17 00:00:00 2001 From: Chaitanya Kuduvalli Ramachandra Date: Wed, 16 Nov 2022 14:56:28 +0530 Subject: [PATCH 1/5] Disable response compression for k8s restAPI in client-go Signed-off-by: Chaitanya Kuduvalli Ramachandra --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 2c547f1493c..ea0dd054146 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,7 @@ 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, @@ -75,6 +76,7 @@ func main() { "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) @@ -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, From 8bbdcbab3f452e40ab0d97c4941ee4c807a7d21a Mon Sep 17 00:00:00 2001 From: Chaitanya Kuduvalli Ramachandra Date: Wed, 16 Nov 2022 15:16:46 +0530 Subject: [PATCH 2/5] Updating metrics server with the same parameters Signed-off-by: Chaitanya Kuduvalli Ramachandra --- adapter/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapter/main.go b/adapter/main.go index 1887c0f4d72..021ab34b6ca 100644 --- a/adapter/main.go +++ b/adapter/main.go @@ -67,6 +67,7 @@ var ( adapterClientRequestQPS float32 adapterClientRequestBurst int metricsAPIServerPort int + disableCompression bool ) func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Duration, maxConcurrentReconciles int) (provider.MetricsProvider, <-chan struct{}, error) { @@ -75,6 +76,7 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat if cfg != nil { cfg.QPS = adapterClientRequestQPS cfg.Burst = adapterClientRequestBurst + cfg.DisableCompression = disableCompression } if err != nil { @@ -209,6 +211,7 @@ func main() { cmd.Flags().StringVar(&prometheusMetricsPath, "metrics-path", "/metrics", "Set the path for the prometheus metrics endpoint") cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver") cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver") + cmd.Flags().BoolVar(&disableCompression, "disable-compression", false, "Disable response compression for k8s restAPI in client-go. ") if err := cmd.Flags().Parse(os.Args); err != nil { return } From 1b97043afe07ff4ce6437b678ea411dc67fae1a5 Mon Sep 17 00:00:00 2001 From: Chaitanya Kuduvalli Ramachandra Date: Wed, 16 Nov 2022 15:20:58 +0530 Subject: [PATCH 3/5] Adding the change to changelog Signed-off-by: Chaitanya Kuduvalli Ramachandra --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 877da376b4f..801d97e4a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio ### New +- **General**: Disable response compression for k8s restAPI in client-go ([#3863](https://github.com/kedacore/keda/issues/3863)) - **General**: Expand Prometheus metric with label "ScalerName" to distinguish different triggers. The scaleName is defined per Trigger.Name ([#3588](https://github.com/kedacore/keda/issues/3588)) - **General:** Introduce new Loki Scaler ([#3699](https://github.com/kedacore/keda/issues/3699)) - **General**: Add ratelimitting parameters to KEDA manager to allow override of client defaults ([#3730](https://github.com/kedacore/keda/issues/2920)) From a3d91344db37ee1623d3db56919b9171fa19d880 Mon Sep 17 00:00:00 2001 From: Chaitanya Kuduvalli Ramachandra Date: Thu, 17 Nov 2022 16:56:58 +0530 Subject: [PATCH 4/5] Set default value to true for disable compression Signed-off-by: Chaitanya Kuduvalli Ramachandra --- CHANGELOG.md | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 801d97e4a3c..2e522cbb368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio ### New -- **General**: Disable response compression for k8s restAPI in client-go ([#3863](https://github.com/kedacore/keda/issues/3863)) +- **General**: Disable response compression for k8s restAPI in client-go ([#3863](https://github.com/kedacore/keda/issues/3863)). Kubernetes issue for reference (https://github.com/kubernetes/kubernetes/issues/112296) - **General**: Expand Prometheus metric with label "ScalerName" to distinguish different triggers. The scaleName is defined per Trigger.Name ([#3588](https://github.com/kedacore/keda/issues/3588)) - **General:** Introduce new Loki Scaler ([#3699](https://github.com/kedacore/keda/issues/3699)) - **General**: Add ratelimitting parameters to KEDA manager to allow override of client defaults ([#3730](https://github.com/kedacore/keda/issues/2920)) diff --git a/main.go b/main.go index ea0dd054146..e7ba811375e 100644 --- a/main.go +++ b/main.go @@ -76,7 +76,7 @@ func main() { "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. ") + pflag.BoolVar(&disableCompression, "disable-compression", true, "Disable response compression for k8s restAPI in client-go. ") opts := zap.Options{} opts.BindFlags(flag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) From c6e7280ecc1acd7fedf8e6b9c8a12d36c1c3ed60 Mon Sep 17 00:00:00 2001 From: Chaitanya Kuduvalli Ramachandra Date: Thu, 17 Nov 2022 17:00:03 +0530 Subject: [PATCH 5/5] Changing default value to true in adapter Signed-off-by: Chaitanya Kuduvalli Ramachandra --- adapter/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter/main.go b/adapter/main.go index 021ab34b6ca..f26d0b71416 100644 --- a/adapter/main.go +++ b/adapter/main.go @@ -211,7 +211,7 @@ func main() { cmd.Flags().StringVar(&prometheusMetricsPath, "metrics-path", "/metrics", "Set the path for the prometheus metrics endpoint") cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver") cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver") - cmd.Flags().BoolVar(&disableCompression, "disable-compression", false, "Disable response compression for k8s restAPI in client-go. ") + cmd.Flags().BoolVar(&disableCompression, "disable-compression", true, "Disable response compression for k8s restAPI in client-go. ") if err := cmd.Flags().Parse(os.Args); err != nil { return }