From 367fcd32f1e72be504ada53165d07c33d75fc0f7 Mon Sep 17 00:00:00 2001 From: aliaqel-stripe <120822631+aliaqel-stripe@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:02:29 -0800 Subject: [PATCH] Set LeaderElectionNamespace to PodNamespace (#5405) * Set LeaderElectionNamespace to PodNamespace Signed-off-by: Ali Aqel * update changelog Signed-off-by: Ali Aqel * move changelog to unreleased Signed-off-by: Ali Aqel * fix changelog Signed-off-by: Ali Aqel * fix changelog ordering Signed-off-by: Ali Aqel * fix changelog per comments Signed-off-by: Ali Aqel --------- Signed-off-by: Ali Aqel --- CHANGELOG.md | 1 + cmd/operator/main.go | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3035f32f834..b45df60f929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -135,6 +135,7 @@ Here is an overview of all new **experimental** features: - **General**: Prevented memory leak generated by not correctly cleaning http connections ([#5248](https://github.com/kedacore/keda/issues/5248)) - **General**: Prevented stuck status due to timeouts during scalers generation ([#5083](https://github.com/kedacore/keda/issues/5083)) - **General**: ScaledObject Validating Webhook should support `dry-run=server` requests ([#5306](https://github.com/kedacore/keda/issues/5306)) +- **General**: Set `LeaderElectionNamespace` to PodNamespace so leader election works in OutOfCluster mode ([#5404](https://github.com/kedacore/keda/issues/5404)) - **AWS Scalers**: Ensure session tokens are included when instantiating AWS credentials ([#5156](https://github.com/kedacore/keda/issues/5156)) - **Azure Event Hub Scaler**: Improve unprocessedEventThreshold calculation ([#4250](https://github.com/kedacore/keda/issues/4250)) - **Azure Pipelines**: Prevent HTTP 400 errors due to `poolName` with spaces ([#5107](https://github.com/kedacore/keda/issues/5107)) diff --git a/cmd/operator/main.go b/cmd/operator/main.go index 387c154602a..945881595fb 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -158,13 +158,14 @@ func main() { Cache: ctrlcache.Options{ DefaultNamespaces: namespaces, }, - HealthProbeBindAddress: probeAddr, - PprofBindAddress: profilingAddr, - LeaderElection: enableLeaderElection, - LeaderElectionID: "operator.keda.sh", - LeaseDuration: leaseDuration, - RenewDeadline: renewDeadline, - RetryPeriod: retryPeriod, + HealthProbeBindAddress: probeAddr, + PprofBindAddress: profilingAddr, + LeaderElection: enableLeaderElection, + LeaderElectionID: "operator.keda.sh", + LeaderElectionNamespace: kedautil.GetPodNamespace(), + LeaseDuration: leaseDuration, + RenewDeadline: renewDeadline, + RetryPeriod: retryPeriod, }) if err != nil { setupLog.Error(err, "unable to start manager")