Skip to content

Commit

Permalink
chore: Release leader election in manager config (kubernetes-sigs#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Dec 20, 2023
1 parent 48d8ee3 commit 095d037
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ func NewOperator() (context.Context, *Operator) {

// Manager
mgrOpts := controllerruntime.Options{
Logger: logging.IgnoreDebugEvents(zapr.NewLogger(logger.Desugar())),
LeaderElection: options.FromContext(ctx).EnableLeaderElection,
LeaderElectionID: "karpenter-leader-election",
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
LeaderElectionNamespace: system.Namespace(),
Scheme: scheme.Scheme,
Logger: logging.IgnoreDebugEvents(zapr.NewLogger(logger.Desugar())),
LeaderElection: options.FromContext(ctx).EnableLeaderElection,
LeaderElectionID: "karpenter-leader-election",
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
LeaderElectionNamespace: system.Namespace(),
LeaderElectionReleaseOnCancel: true,
Scheme: scheme.Scheme,
Metrics: server.Options{
BindAddress: fmt.Sprintf(":%d", options.FromContext(ctx).MetricsPort),
},
Expand Down

0 comments on commit 095d037

Please sign in to comment.