Skip to content

Commit fb4f33b

Browse files
committed
Merge commit 'refs/pull/51/head' of github.com:TremoloSecurity/kube-oidc-proxy
for #65 merging PR for testing
2 parents 2a14939 + d8142dd commit fb4f33b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

cmd/app/options/client.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import (
1010

1111
type ClientOptions struct {
1212
*genericclioptions.ConfigFlags
13+
14+
KubeClientQPS float32
15+
KubeClientBurst int
1316
}
1417

1518
func NewClientOptions(nfs *cliflag.NamedFlagSets) *ClientOptions {
@@ -27,6 +30,15 @@ func NewClientOptions(nfs *cliflag.NamedFlagSets) *ClientOptions {
2730

2831
func (c *ClientOptions) AddFlags(fs *pflag.FlagSet) *ClientOptions {
2932
c.ConfigFlags.AddFlags(fs)
33+
34+
// Extra flags
35+
fs.Float32Var(&c.KubeClientQPS, "kube-client-qps", c.KubeClientQPS, "Sets the QPS on the app "+
36+
"kubernetes client, this will configure throttling on requests sent to the apiserver "+
37+
"(If not set, it will use client default ones)")
38+
fs.IntVar(&c.KubeClientBurst, "kube-client-burst", c.KubeClientBurst, "Sets the burst on the app "+
39+
"kubernetes client, this will configure throttling on requests sent to the apiserver"+
40+
"(If not set, it will use client default ones)")
41+
3042
return c
3143
}
3244

cmd/app/run.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ func buildRunCommand(stopCh <-chan struct{}, opts *options.Options) *cobra.Comma
5959
}
6060
}
6161

62+
// Set client throttling settings for Kubernetes clients.
63+
if opts.Client.KubeClientBurst > 0 {
64+
restConfig.Burst = opts.Client.KubeClientBurst
65+
}
66+
if opts.Client.KubeClientQPS > 0 {
67+
restConfig.QPS = opts.Client.KubeClientQPS
68+
}
69+
6270
// Initialise token reviewer if enabled
6371
var tokenReviewer *tokenreview.TokenReview
6472
if opts.App.TokenPassthrough.Enabled {

0 commit comments

Comments
 (0)