From 2d8fb8cd0987fe99ab0ec134dadd77c6810fa9bd Mon Sep 17 00:00:00 2001 From: Ashwin Venkatesh Date: Thu, 8 Apr 2021 18:52:12 -0400 Subject: [PATCH] Add HA support to endpoints controller (#479) * Support HA for the endpoints controller - The controller manager allows for multiple instances of the controller to run using leader election. By configuring leader election, one of the instances of the controller (the leader) will run the reconciler. All instances can serve the webhook though, but only on the instances will inject the containers per request. This requires additional priveleges from an RBAC perspective that will be a part of a helm commit. --- subcommand/inject-connect/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subcommand/inject-connect/command.go b/subcommand/inject-connect/command.go index 6cb4571a83..4531c6cb4c 100644 --- a/subcommand/inject-connect/command.go +++ b/subcommand/inject-connect/command.go @@ -362,7 +362,8 @@ func (c *Command) Run(args []string) int { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - LeaderElection: false, + LeaderElection: true, + LeaderElectionID: "consul-controller-lock", Host: listenSplits[0], Port: port, Logger: zapLogger,