Skip to content

Commit

Permalink
add health-probe-bind-address
Browse files Browse the repository at this point in the history
  • Loading branch information
test committed Oct 27, 2022
1 parent 9958ae3 commit d110200
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ func init() {

func main() {
var enableLeaderElection bool

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

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
LeaderElection: enableLeaderElection,
LeaderElectionID: "1237ab00.plural.sh",
MetricsBindAddress: "0",
Scheme: scheme,
LeaderElection: enableLeaderElection,
LeaderElectionID: "1237ab00.plural.sh",
MetricsBindAddress: metricsAddr,
HealthProbeBindAddress: probeAddr,
})
if err != nil {
setupLog.Error(err, "unable to create manager")
Expand Down

0 comments on commit d110200

Please sign in to comment.