Skip to content

Commit

Permalink
Make throttling params qps and burst configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Zhu committed Feb 26, 2024
1 parent 6800f44 commit 569fe1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
var (
endpointDir = flag.String("provider-volume", "/etc/kubernetes/secrets-store-csi-providers", "Rendezvous directory for provider socket")
driverWriteSecrets = flag.Bool("driver-writes-secrets", false, "The driver will do the write instead of the plugin")
qps = flag.Int("qps", 20, "Maximum query per second to the master")
burst = flag.Int("burst", 40, "Maximum burst for throttle")
)

// Main entry point for the Secret Store CSI driver AWS provider. This main
Expand Down Expand Up @@ -58,6 +60,9 @@ func main() {
klog.Fatalf("Can not get cluster config. error: %v", err)
}

cfg.QPS = float32(*qps)
cfg.Burst = *burst

clientset, err := kubernetes.NewForConfig(cfg)
if err != nil {
klog.Fatalf("Can not initialize kubernetes client. error: %v", err)
Expand Down

0 comments on commit 569fe1c

Please sign in to comment.