mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 07:41:36 +02:00
Add abitility to set QPS and Burst limits for api client (#2667)
* Add abitility to set QPS and Burst limits for api client --------- Co-authored-by: Ivan Sokoryan <i.sokoryan@robo.cash> Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
co-authored by
Ivan Sokoryan
Felix Kunde
parent
470a1eab89
commit
d97c271b84
@@ -35,6 +35,8 @@ func init() {
|
||||
flag.BoolVar(&outOfCluster, "outofcluster", false, "Whether the operator runs in- our outside of the Kubernetes cluster.")
|
||||
flag.BoolVar(&config.NoDatabaseAccess, "nodatabaseaccess", false, "Disable all access to the database from the operator side.")
|
||||
flag.BoolVar(&config.NoTeamsAPI, "noteamsapi", false, "Disable all access to the teams API")
|
||||
flag.IntVar(&config.KubeQPS, "kubeqps", 10, "Kubernetes api requests per second.")
|
||||
flag.IntVar(&config.KubeBurst, "kubeburst", 20, "Kubernetes api requests burst limit.")
|
||||
flag.Parse()
|
||||
|
||||
config.EnableJsonLogging = os.Getenv("ENABLE_JSON_LOGGING") == "true"
|
||||
@@ -83,6 +85,9 @@ func main() {
|
||||
log.Fatalf("couldn't get REST config: %v", err)
|
||||
}
|
||||
|
||||
config.RestConfig.QPS = float32(config.KubeQPS)
|
||||
config.RestConfig.Burst = config.KubeBurst
|
||||
|
||||
c := controller.NewController(&config, "")
|
||||
|
||||
c.Run(stop, wg)
|
||||
|
||||
Reference in New Issue
Block a user