Add health addr flag
@@ -39,10 +39,12 @@ func main() {
setupLog := ctrl.Log.WithName("setup")
var metricsAddr string
+ var healthAddr string
var enableLeaderElection bool
// default here for 'metricsAddr' is set to "0", which sets metrics to be disabled if 'metrics-addr' flag is omitted.
flagSet.StringVar(&metricsAddr, "metrics-addr", "0", "The address the metric endpoint binds to.")
+ flagSet.StringVar(&healthAddr, "health-addr", "", "The address the healthz endpoint binds to.")
flagSet.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controllers manager. Enabling this will ensure there is only one active controllers manager.")
flagSet.Parse(os.Args[1:]) //nolint:errcheck
@@ -72,6 +74,7 @@ func main() {
LeaderElection: enableLeaderElection,
LeaderElectionID: "controllers-leader-election-azinfra-generated",
Port: 9443,
+ HealthProbeBindAddress: healthAddr,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
