From 2800c16c8b97991b228c00b86934daa134f08add Mon Sep 17 00:00:00 2001 From: Antoni Zawodny Date: Tue, 8 Apr 2025 13:57:46 +0200 Subject: [PATCH] Remove FlowSchemas handling non-leases-backed leader election --- .../pkg/apis/flowcontrol/bootstrap/default.go | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go b/staging/src/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go index aca968de643..6f23d481b21 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go @@ -73,8 +73,6 @@ var ( SuggestedFlowSchemaSystemNodeHigh, // references "node-high" priority-level SuggestedFlowSchemaProbes, // references "exempt" priority-level SuggestedFlowSchemaSystemLeaderElection, // references "leader-election" priority-level - SuggestedFlowSchemaWorkloadLeaderElection, // references "leader-election" priority-level - SuggestedFlowSchemaEndpointsController, // references "workload-high" priority-level SuggestedFlowSchemaKubeControllerManager, // references "workload-high" priority-level SuggestedFlowSchemaKubeScheduler, // references "workload-high" priority-level SuggestedFlowSchemaKubeSystemServiceAccounts, // references "workload-high" priority-level @@ -310,52 +308,6 @@ var ( }, }, ) - // We add an explicit rule for endpoint-controller with high precedence - // to ensure that those calls won't get caught by the following - // flow-schema. - // - // TODO(#80289): Get rid of this rule once we get rid of support for - // using endpoints and configmaps objects for leader election. - SuggestedFlowSchemaEndpointsController = newFlowSchema( - "endpoint-controller", "workload-high", 150, - flowcontrol.FlowDistinguisherMethodByUserType, - flowcontrol.PolicyRulesWithSubjects{ - Subjects: append( - users(user.KubeControllerManager), - kubeSystemServiceAccount("endpoint-controller", "endpointslicemirroring-controller")...), - ResourceRules: []flowcontrol.ResourcePolicyRule{ - resourceRule( - []string{"get", "create", "update"}, - []string{corev1.GroupName}, - []string{"endpoints"}, - []string{flowcontrol.NamespaceEvery}, - false), - }, - }, - ) - // TODO(#80289): Get rid of this rule once we get rid of support for - // using endpoints and configmaps objects for leader election. - SuggestedFlowSchemaWorkloadLeaderElection = newFlowSchema( - "workload-leader-election", "leader-election", 200, - flowcontrol.FlowDistinguisherMethodByUserType, - flowcontrol.PolicyRulesWithSubjects{ - Subjects: kubeSystemServiceAccount(flowcontrol.NameAll), - ResourceRules: []flowcontrol.ResourcePolicyRule{ - resourceRule( - []string{"get", "create", "update"}, - []string{corev1.GroupName}, - []string{"endpoints", "configmaps"}, - []string{flowcontrol.NamespaceEvery}, - false), - resourceRule( - []string{"get", "create", "update"}, - []string{coordinationv1.GroupName}, - []string{"leases"}, - []string{flowcontrol.NamespaceEvery}, - false), - }, - }, - ) SuggestedFlowSchemaSystemNodeHigh = newFlowSchema( "system-node-high", "node-high", 400, flowcontrol.FlowDistinguisherMethodByUserType,