From bda95a59adad71146104a61290957449d4d2a73d Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 9 Jan 2017 17:45:12 -0500 Subject: [PATCH] Allow node-controller to update node status --- .../rbac/bootstrappolicy/controller_policy.go | 6 ++++- .../testdata/controller-roles.yaml | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go index 19f0632d3df..96828a7f3fd 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go @@ -166,7 +166,11 @@ func init() { addControllerRole(rbac.ClusterRole{ ObjectMeta: api.ObjectMeta{Name: saRolePrefix + "node-controller"}, Rules: []rbac.PolicyRule{ - rbac.NewRule("get", "list", "update").Groups(legacyGroup).Resources("nodes").RuleOrDie(), + rbac.NewRule("get", "list", "update", "delete").Groups(legacyGroup).Resources("nodes").RuleOrDie(), + rbac.NewRule("update").Groups(legacyGroup).Resources("nodes/status").RuleOrDie(), + // used for pod eviction + rbac.NewRule("update").Groups(legacyGroup).Resources("pods/status").RuleOrDie(), + rbac.NewRule("list", "delete").Groups(legacyGroup).Resources("pods").RuleOrDie(), eventsRule(), }, }) diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/controller-roles.yaml b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/controller-roles.yaml index add13f97bb7..362b8f87d94 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/controller-roles.yaml +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/controller-roles.yaml @@ -533,9 +533,32 @@ items: resources: - nodes verbs: + - delete - get - list - update + - apiGroups: + - "" + attributeRestrictions: null + resources: + - nodes/status + verbs: + - update + - apiGroups: + - "" + attributeRestrictions: null + resources: + - pods/status + verbs: + - update + - apiGroups: + - "" + attributeRestrictions: null + resources: + - pods + verbs: + - delete + - list - apiGroups: - "" attributeRestrictions: null