Skip to content

Commit

Permalink
feat: Allow to change the Admission Webhooks port
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Cantin <103442330+mcantinqc@users.noreply.github.com>
  • Loading branch information
mcantinqc committed Jun 21, 2023
1 parent 0e7662d commit dd9f284
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
- **RabbitMQ Scaler**: Add support for `unsafeSsl` in trigger metadata ([#4448](https://github.com/kedacore/keda/issues/4448))
- **Prometheus Metrics**: Add new metric with KEDA build info ([#4647](https://github.com/kedacore/keda/issues/4647))
- **Prometheus Scaler**: Add support for Google Managed Prometheus ([#4675](https://github.com/kedacore/keda/pull/4675))
- **Admission Webhooks**: Allow to change the port ([#468](https://github.com/kedacore/charts/issues/468))

### Fixes

Expand Down
4 changes: 3 additions & 1 deletion cmd/webhooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ func main() {
var webhooksClientRequestQPS float32
var webhooksClientRequestBurst int
var certDir string
var webhooksPort int

pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
pflag.Float32Var(&webhooksClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
pflag.IntVar(&webhooksClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
pflag.StringVar(&certDir, "cert-dir", "/certs", "Webhook certificates dir to use. Defaults to /certs")
pflag.IntVar(&webhooksPort, "port", 9443, "Port number to serve webhooks. Defaults to 9443")

opts := zap.Options{}
opts.BindFlags(flag.CommandLine)
Expand All @@ -81,7 +83,7 @@ func main() {
LeaderElection: false,
MetricsBindAddress: metricsAddr,
WebhookServer: webhook.NewServer(webhook.Options{
Port: 9443,
Port: webhooksPort,
CertDir: certDir,
TLSOpts: []func(tlsConfig *tls.Config){
func(tlsConfig *tls.Config) {
Expand Down

0 comments on commit dd9f284

Please sign in to comment.