Skip to content

Commit

Permalink
Add ratelimitting parameters to keda manager to allow override of cli…
Browse files Browse the repository at this point in the history
…ent defaults

Signed-off-by: Valentin Flaux <valentin_flaux@connect-tech.sncf>
  • Loading branch information
vflaux committed Oct 9, 2022
1 parent 14ece68 commit 8e2a242
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
### New

- **General**: Provide Prometheus metric with indication of total number of triggers per trigger type in `ScaledJob`/`ScaledObject`. ([#3663](https://github.com/kedacore/keda/issues/3663))
- **General**: Add ratelimitting parameters to keda manager to allow override of client defaults ([#3730](https://github.com/kedacore/keda/issues/2920))
- **Azure Service Bus Scaler**: Add support for Shared Access Signature (SAS) tokens for authentication. ([#2920](https://github.com/kedacore/keda/issues/2920))
- **Azure Service Bus Scaler:** Support regex usage in queueName / subscriptionName parameters. ([#1624](https://github.com/kedacore/keda/issues/1624))

Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
var adapterClientRequestQPS float64
var adapterClientRequestBurst int
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.Float64Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
flag.IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
opts := zap.Options{}
opts.BindFlags(flag.CommandLine)

Expand Down Expand Up @@ -101,7 +105,11 @@ func main() {
os.Exit(1)
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
cfg := ctrl.GetConfigOrDie()
cfg.QPS = float32(adapterClientRequestQPS)
cfg.Burst = adapterClientRequestBurst

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

0 comments on commit 8e2a242

Please sign in to comment.