diff --git a/bundle/manifests/opendatahub-operator-manager-config_v1_configmap.yaml b/bundle/manifests/opendatahub-operator-manager-config_v1_configmap.yaml index 52f36dfbb62..99bb8b739f3 100644 --- a/bundle/manifests/opendatahub-operator-manager-config_v1_configmap.yaml +++ b/bundle/manifests/opendatahub-operator-manager-config_v1_configmap.yaml @@ -9,19 +9,6 @@ data: bindAddress: 0.0.0.0:8080 webhook: port: 9443 - leaderElection: - leaderElect: true - resourceName: 07ed84f7.opendatahub.io - # leaderElectionReleaseOnCancel defines if the leader should step down volume - # when the Manager ends. This requires the binary to immediately end when the - # Manager is stopped, otherwise, this setting is unsafe. Setting this significantly - # speeds up voluntary leader transitions as the new leader don't have to wait - # LeaseDuration time first. - # In the default scaffold provided, the program ends immediately after - # the manager stops, so would be fine to enable this option. However, - # if you are doing or is intended to do any operation such as perform cleanups - # after the manager stops then its usage might be unsafe. - # leaderElectionReleaseOnCancel: true kind: ConfigMap metadata: name: opendatahub-operator-manager-config diff --git a/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml b/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml index 95c38f35913..0a602660189 100644 --- a/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml +++ b/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml @@ -1674,7 +1674,6 @@ spec: - args: - --health-probe-bind-address=:8081 - --metrics-bind-address=0.0.0.0:8080 - - --leader-elect - --operator-name=opendatahub command: - /manager diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 348b4430479..287adcc0029 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -13,4 +13,3 @@ spec: args: - "--health-probe-bind-address=:8081" - "--metrics-bind-address=0.0.0.0:8080" - - "--leader-elect" diff --git a/config/manager/controller_manager_config.yaml b/config/manager/controller_manager_config.yaml index 29840e17aef..ec87ba2becd 100644 --- a/config/manager/controller_manager_config.yaml +++ b/config/manager/controller_manager_config.yaml @@ -6,16 +6,3 @@ metrics: bindAddress: 0.0.0.0:8080 webhook: port: 9443 -leaderElection: - leaderElect: true - resourceName: 07ed84f7.opendatahub.io -# leaderElectionReleaseOnCancel defines if the leader should step down volume -# when the Manager ends. This requires the binary to immediately end when the -# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly -# speeds up voluntary leader transitions as the new leader don't have to wait -# LeaseDuration time first. -# In the default scaffold provided, the program ends immediately after -# the manager stops, so would be fine to enable this option. However, -# if you are doing or is intended to do any operation such as perform cleanups -# after the manager stops then its usage might be unsafe. -# leaderElectionReleaseOnCancel: true diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index f7b912533c6..7706cd69231 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -41,7 +41,6 @@ spec: - name: DISABLE_DSC_CONFIG value: 'true' args: - - --leader-elect - --operator-name=opendatahub image: controller:latest imagePullPolicy: Always diff --git a/main.go b/main.go index 14d9eb0c7c7..6036843a136 100644 --- a/main.go +++ b/main.go @@ -95,7 +95,6 @@ func init() { //nolint:gochecknoinits func main() { //nolint:funlen var metricsAddr string - var enableLeaderElection bool var probeAddr string var dscApplicationsNamespace string var dscMonitoringNamespace string @@ -104,9 +103,6 @@ func main() { //nolint:funlen flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, - "Enable leader election for controller manager. "+ - "Enabling this will ensure there is only one active controller manager.") flag.StringVar(&dscApplicationsNamespace, "dsc-applications-namespace", "opendatahub", "The namespace where data science cluster"+ "applications will be deployed") flag.StringVar(&dscMonitoringNamespace, "dsc-monitoring-namespace", "opendatahub", "The namespace where data science cluster"+ @@ -118,24 +114,11 @@ func main() { //nolint:funlen ctrl.SetLogger(logger.ConfigLoggers(logmode)) - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ // single pod does not need to have LeaderElection Scheme: scheme, MetricsBindAddress: metricsAddr, Port: 9443, HealthProbeBindAddress: probeAddr, - LeaderElection: enableLeaderElection, - LeaderElectionID: "07ed84f7.opendatahub.io", - // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily - // when the Manager ends. This requires the binary to immediately end when the - // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly - // speeds up voluntary leader transitions as the new leader don't have to wait - // LeaseDuration time first. - // - // In the default scaffold provided, the program ends immediately after - // the manager stops, so would be fine to enable this option. However, - // if you are doing or is intended to do any operation such as perform cleanups - // after the manager stops then its usage might be unsafe. - // LeaderElectionReleaseOnCancel: true, }) if err != nil { setupLog.Error(err, "unable to start manager")