Skip to content

Commit

Permalink
Merge pull request #66 from mlbiam/master
Browse files Browse the repository at this point in the history
1.0.9
  • Loading branch information
mlbiam authored Jan 9, 2025
2 parents 1ebffbd + f255b40 commit 6c7b92b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: generate tag
run: |-
export PROJ_VERSION="1.0.8"
export PROJ_VERSION="1.0.9"
echo "Project Version: $PROJ_VERSION"
echo "TAG=$PROJ_VERSION-$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
echo "SHORT_TAG=$PROJ_VERSION" >> $GITHUB_ENV
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.0.9

**tasks:**
- 1.0.9 [\#64](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/64)

**enhancements:**
- Add flags to be able to configure kubernetes client throttling [\#65](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/65)

# 1.0.8

**tasks:**
Expand Down
12 changes: 12 additions & 0 deletions cmd/app/options/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (

type ClientOptions struct {
*genericclioptions.ConfigFlags

KubeClientQPS float32
KubeClientBurst int
}

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

func (c *ClientOptions) AddFlags(fs *pflag.FlagSet) *ClientOptions {
c.ConfigFlags.AddFlags(fs)

// Extra flags
fs.Float32Var(&c.KubeClientQPS, "kube-client-qps", c.KubeClientQPS, "Sets the QPS on the app "+
"kubernetes client, this will configure throttling on requests sent to the apiserver "+
"(If not set, it will use client default ones)")
fs.IntVar(&c.KubeClientBurst, "kube-client-burst", c.KubeClientBurst, "Sets the burst on the app "+
"kubernetes client, this will configure throttling on requests sent to the apiserver"+
"(If not set, it will use client default ones)")

return c
}

Expand Down
8 changes: 8 additions & 0 deletions cmd/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ func buildRunCommand(stopCh <-chan struct{}, opts *options.Options) *cobra.Comma
}
}

// Set client throttling settings for Kubernetes clients.
if opts.Client.KubeClientBurst > 0 {
restConfig.Burst = opts.Client.KubeClientBurst
}
if opts.Client.KubeClientQPS > 0 {
restConfig.QPS = opts.Client.KubeClientQPS
}

// Initialise token reviewer if enabled
var tokenReviewer *tokenreview.TokenReview
if opts.App.TokenPassthrough.Enabled {
Expand Down

0 comments on commit 6c7b92b

Please sign in to comment.