diff --git a/vertical-pod-autoscaler/deploy/vpa-rbac.yaml b/vertical-pod-autoscaler/deploy/vpa-rbac.yaml index b04707a19f9b..a41f468a7383 100644 --- a/vertical-pod-autoscaler/deploy/vpa-rbac.yaml +++ b/vertical-pod-autoscaler/deploy/vpa-rbac.yaml @@ -410,7 +410,9 @@ rules: - apiGroups: - "coordination.k8s.io" resourceNames: + # TODO: Clean vpa-recommender up once vpa-recommender-lease is used everywhere. See https://github.com/kubernetes/autoscaler/issues/7461. - vpa-recommender + - vpa-recommender-lease resources: - leases verbs: diff --git a/vertical-pod-autoscaler/pkg/recommender/main.go b/vertical-pod-autoscaler/pkg/recommender/main.go index afa7c1629375..2b6b79b9a602 100644 --- a/vertical-pod-autoscaler/pkg/recommender/main.go +++ b/vertical-pod-autoscaler/pkg/recommender/main.go @@ -182,12 +182,13 @@ const ( func defaultLeaderElectionConfiguration() componentbaseconfig.LeaderElectionConfiguration { return componentbaseconfig.LeaderElectionConfiguration{ - LeaderElect: false, - LeaseDuration: metav1.Duration{Duration: defaultLeaseDuration}, - RenewDeadline: metav1.Duration{Duration: defaultRenewDeadline}, - RetryPeriod: metav1.Duration{Duration: defaultRetryPeriod}, - ResourceLock: resourcelock.LeasesResourceLock, - ResourceName: "vpa-recommender", + LeaderElect: false, + LeaseDuration: metav1.Duration{Duration: defaultLeaseDuration}, + RenewDeadline: metav1.Duration{Duration: defaultRenewDeadline}, + RetryPeriod: metav1.Duration{Duration: defaultRetryPeriod}, + ResourceLock: resourcelock.LeasesResourceLock, + // This was changed from "vpa-recommender" to avoid conflicts with managed VPA deployments. + ResourceName: "vpa-recommender-lease", ResourceNamespace: metav1.NamespaceSystem, } }