Skip to content

Running leader election on KEDA running outside of cluster mode #5404

Closed
@aliaqel-stripe

Description

Report

Similar to what we experienced running Out Of Cluster mode in Karpenter here, when trying to run leader election in OutOfCluster mode (i.e when we pass a kubeconfig file as a launch arg), the KEDA operator crashes on launch with

unable to find leader election namespace: not running in-cluster, please specify LeaderElectionNamespace

I believe for KEDA since we have kedautil.GetPodNamespace() already, we can add

LeaderElectionNamespace: kedautil.GetPodNamespace(),

to the controller manager initializer .

Expected Behavior

When running in OutOfCluster mode with a passed in Kubeconfig, Leader Election should work.

Actual Behavior

KEDA crashes on launch with

unable to find leader election namespace: not running in-cluster, please specify LeaderElectionNamespace

Steps to Reproduce the Problem

  1. Run KEDA-Operator in OutOfCluster mode by passing in kubeconfig file as launch arg
  2. Enable Leader Election

Logs from KEDA operator

unable to find leader election namespace: not running in-cluster, please specify LeaderElectionNamespace

KEDA Version

None

Kubernetes Version

1.25

Platform

Amazon Web Services

Scaler Details

No response

Anything else?

No response

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status

      Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions