Skip to content

Commit

Permalink
added flag for webhook port configuration (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Sep 16, 2024
1 parent 8e6eacc commit fe90f57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ aliases:
- [operator](https://docs.victoriametrics.com/operator/): reduces reconcile latency. See this [commit](2a9d09d0131cc10a0f9e32f0e2e054687ada78f7) for details.
- [operator](https://docs.victoriametrics.com/operator/): reduces load on kubernetes api-server. See this commits: [commit-0](a0145b8a89dd5bb9051f8d4359b6a70c1d1a95ce), [commit-1](e2fbbd3e37146670f656d700ad0f64b2c299b0a0), [commit-2](184ba19a5f1d10dc2ac1bf018b2729f64e2a8c25).
- [operator](https://docs.victoriametrics.com/operator/): enables client cache back for `secrets` and `configmaps`. Adds new flag `-controller.disableCacheFor=seccret,configmap` to disable it if needed.
- [operator](https://docs.victoriametrics.com/operator/): made webhook port configurable. See [this issue](https://github.com/VictoriaMetrics/operator/issues/1106) for details.

## [v0.47.3](https://github.com/VictoriaMetrics/operator/releases/tag/v0.47.3) - 28 Aug 2024

Expand Down
4 changes: 3 additions & 1 deletion internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
)

const defaultMetricsAddr = ":8080"
const defaultWebhookPort = 9443

var (
startTime = time.Now()
Expand All @@ -62,6 +63,7 @@ var (
setupLog = ctrl.Log.WithName("setup")
leaderElect = flag.Bool("leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
enableWebhooks = flag.Bool("webhook.enable", false, "adds webhook server, you must mount cert and key or use cert-manager")
webhookPort = flag.Int("webhook.port", defaultWebhookPort, "port to start webhook server on")
disableCRDOwnership = flag.Bool("controller.disableCRDOwnership", false, "disables CRD ownership add to cluster wide objects, must be disabled for clusters, lower than v1.16.0")
webhooksDir = flag.String("webhook.certDir", "/tmp/k8s-webhook-server/serving-certs/", "root directory for webhook cert and key")
webhookCertName = flag.String("webhook.certName", "tls.crt", "name of webhook server Tls certificate inside tls.certDir")
Expand Down Expand Up @@ -174,7 +176,7 @@ func RunManager(ctx context.Context) error {
LivenessEndpointName: "/health",
// port for webhook
WebhookServer: webhook.NewServer(webhook.Options{
Port: 9443,
Port: *webhookPort,
CertDir: *webhooksDir,
CertName: *webhookCertName,
KeyName: *webhookKeyName,
Expand Down

0 comments on commit fe90f57

Please sign in to comment.