Skip to content

Commit a7396fd

Browse files
committed
kubelet: grant permission for DeleteCollection also with RBAC
If the node authorizer is active, RBAC rules are not needed. But if it's disabled, kubelet needs to get permission through RBAC. In contrast to the authorizer code which is a bit more flexible and isn't directly tied to the current kubelet implementation (i.e. it allows list+delete instead of just deletecollection), the RBAC entry is just for what the current kubelet does because it's a bit easier to change.
1 parent 7701a48 commit a7396fd

File tree

1 file changed

+1
-0
lines changed
  • plugin/pkg/auth/authorizer/rbac/bootstrappolicy

1 file changed

+1
-0
lines changed

plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func NodeRules() []rbacv1.PolicyRule {
181181
// DRA Resource Claims
182182
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
183183
nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("get").Groups(resourceGroup).Resources("resourceclaims").RuleOrDie())
184+
nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("deletecollection").Groups(resourceGroup).Resources("resourceslices").RuleOrDie())
184185
}
185186
// Kubelet needs access to ClusterTrustBundles to support the pemTrustAnchors volume type.
186187
if utilfeature.DefaultFeatureGate.Enabled(features.ClusterTrustBundle) {

0 commit comments

Comments
 (0)