diff --git a/cmd/apinetlet/main.go b/cmd/apinetlet/main.go index 77843c83..4c96bf5b 100644 --- a/cmd/apinetlet/main.go +++ b/cmd/apinetlet/main.go @@ -18,20 +18,19 @@ import ( networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" "github.com/ironcore-dev/ironcore/utils/client/config" flag "github.com/spf13/pflag" - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/cluster" - metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" //+kubebuilder:scaffold:imports ) @@ -128,6 +127,7 @@ func main() { }, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, + LeaderElectionConfig: apiNetCfg, LeaderElectionID: "fa89daf5.apinetlet.apinet.ironcore.dev", Cache: cache.Options{ DefaultNamespaces: cacheDefaultNamespaces,