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

allow to customize healthz & webhook-server port #2354

Merged
merged 2 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion addons/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type addonFlags struct {
addonClusterRoleBinding string
addonImagePullPolicy string
corePackageRepoName string
webhookServerPort int
healthdAddr string
ipFamilyClusterVarName string
featureGateClusterBootstrap bool
Expand Down Expand Up @@ -120,6 +121,7 @@ func parseAddonFlags(addonFlags *addonFlags) {
flag.StringVar(&addonFlags.addonImagePullPolicy, "addon-image-pull-policy", "IfNotPresent", "The addon image pull policy")
flag.StringVar(&addonFlags.corePackageRepoName, "core-package-repo-name", "tanzu-core", "The name of core package repository")
flag.StringVar(&addonFlags.healthdAddr, "health-addr", ":18316", "The address the health endpoint binds to.")
flag.IntVar(&addonFlags.webhookServerPort, "webhook-server-port", 9865, "The port that the webhook server serves at.")
flag.StringVar(&addonFlags.ipFamilyClusterVarName, "ip-family-cluster-var-name", constants.DefaultIPFamilyClusterClassVarName, "IP family setting cluster variable name")
flag.BoolVar(&addonFlags.featureGateClusterBootstrap, "feature-gate-cluster-bootstrap", false, "Feature gate to enable clusterbootstap and addonconfig controllers that rely on TKR v1alphav3")
flag.BoolVar(&addonFlags.featureGatePackageInstallStatus, "feature-gate-package-install-status", false, "Feature gate to enable packageinstallstatus controller")
Expand Down Expand Up @@ -165,7 +167,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: flags.metricsAddr,
Port: 9865,
Port: flags.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,8 @@ spec:
- args:
- --metrics-bind-addr=0
- --leader-elect=false
- --health-addr=:18316
- #@ "--health-addr=:{}".format(data.values.tanzuAddonsManager.deployment.healthzPort)
- #@ "--webhook-server-port={}".format(data.values.tanzuAddonsManager.deployment.webhookServerPort)
- #@ "--addon-namespace={}".format(data.values.tanzuAddonsManager.namespace)
#@ if/end data.values.tanzuAddonsManager.featureGates.clusterBootstrapController:
- --feature-gate-cluster-bootstrap=true
ggpaue marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -263,10 +264,10 @@ spec:
cpu: 100m
memory: 40Mi
ports:
- containerPort: 9865
- containerPort: #@ data.values.tanzuAddonsManager.deployment.webhookServerPort
name: webhook-server
protocol: TCP
- containerPort: 18316
- containerPort: #@ data.values.tanzuAddonsManager.deployment.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
ggpaue marked this conversation as resolved.
Show resolved Hide resolved
healthzPort: 18316
featureGates:
clusterBootstrapController: false
Expand Down
1 change: 1 addition & 0 deletions packages/management/framework/bundle/config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ addonsManagerPackageValues:
priorityClassName: system-cluster-critical
nodeSelector: null
tolerations: []
webhookServerPort: 9865
healthzPort: 18316
featureGates:
clusterBootstrapController: false
Expand Down
2 changes: 2 additions & 0 deletions packages/management/tkg/bundle/config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ frameworkPackage:
priorityClassName: system-cluster-critical
nodeSelector: null
tolerations: []
webhookServerPort: 9865
healthzPort: 18316
featureGates:
clusterBootstrapController: false
packageInstallStatus: false
Expand Down