Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
allow to customize healthz & webhook-server port
Browse files Browse the repository at this point in the history
  • Loading branch information
ggpaue committed May 12, 2022
1 parent bd22dcc commit 95a3f68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion addons/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ func parseAddonFlags(addonFlags *addonFlags) {
}

func main() {
var webhookServerPort int
flag.IntVar(&webhookServerPort, "webhook-server-port", 9865, "The port that the webhook server serves at.")

// parse flags
flags := &addonFlags{}
parseAddonFlags(flags)
Expand Down Expand Up @@ -165,7 +168,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: flags.metricsAddr,
Port: 9865,
Port: webhookServerPort,
CertDir: constants.WebhookCertDir,
LeaderElection: flags.enableLeaderElection,
LeaderElectionID: "5832a104.run.tanzu.addons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ spec:
- args:
- --metrics-bind-addr=0
- --leader-elect=false
- --health-addr=:18316
- #@ "--health-addr=:{}".format(data.values.tanzuAddonsManager.healthzPort)
- #@ "--addon-namespace={}".format(data.values.tanzuAddonsManager.namespace)
#@ if/end data.values.tanzuAddonsManager.featureGates.clusterBootstrapController:
- --feature-gate-cluster-bootstrap=true
Expand All @@ -261,10 +261,10 @@ spec:
cpu: 100m
memory: 40Mi
ports:
- containerPort: 9865
- containerPort: #@ data.values.tanzuAddonsManager.webhookServerPort
name: webhook-server
protocol: TCP
- containerPort: 18316
- containerPort: #@ data.values.tanzuAddonsManager.healthzPort
name: healthz
protocol: TCP
readinessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tanzuAddonsManager:
priorityClassName: null
nodeSelector: null
tolerations: []
webhookServerPort: 9865
healthzPort: 18316
featureGates:
clusterBootstrapController: false

0 comments on commit 95a3f68

Please # to comment.