Skip to content

Commit d110200

Browse files
author
test
committed
add health-probe-bind-address
1 parent 9958ae3 commit d110200

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cmd/main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ func init() {
3030

3131
func main() {
3232
var enableLeaderElection bool
33-
33+
var metricsAddr string
34+
var probeAddr string
35+
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
36+
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
3437
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
3538
"Enable leader election for controller manager. "+
3639
"Enabling this will ensure there is only one active controller manager.")
@@ -43,10 +46,11 @@ func main() {
4346
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
4447

4548
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
46-
Scheme: scheme,
47-
LeaderElection: enableLeaderElection,
48-
LeaderElectionID: "1237ab00.plural.sh",
49-
MetricsBindAddress: "0",
49+
Scheme: scheme,
50+
LeaderElection: enableLeaderElection,
51+
LeaderElectionID: "1237ab00.plural.sh",
52+
MetricsBindAddress: metricsAddr,
53+
HealthProbeBindAddress: probeAddr,
5054
})
5155
if err != nil {
5256
setupLog.Error(err, "unable to create manager")

0 commit comments

Comments
 (0)