Skip to content

Commit

Permalink
Add flag leader-election-namespace (ray-project#1624)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenk008 authored Dec 1, 2023
1 parent 867b0e4 commit a34a42a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ray-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func main() {
var version bool
var metricsAddr string
var enableLeaderElection bool
var leaderElectionNamespace string
var probeAddr string
var reconcileConcurrency int
var watchNamespace string
Expand All @@ -64,6 +65,8 @@ func main() {
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8082", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", true,
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
flag.StringVar(&leaderElectionNamespace, "leader-election-namespace", "",
"Namespace where the leader election resource lives. Defaults to the pod namespace if not set.")
flag.IntVar(&reconcileConcurrency, "reconcile-concurrency", 1, "max concurrency for reconciling")
flag.StringVar(
&watchNamespace,
Expand Down Expand Up @@ -129,9 +132,10 @@ func main() {
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "ray-operator-leader",
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "ray-operator-leader",
LeaderElectionNamespace: leaderElectionNamespace,
}

// Manager Cache
Expand Down

0 comments on commit a34a42a

Please sign in to comment.