diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go index ca0c5d921d7..a34d217f326 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go @@ -171,6 +171,13 @@ func ClusterRoles() []rbac.ClusterRole { "replicationcontrollers/scale", "replicasets", "replicasets/scale", "deployments", "deployments/scale").RuleOrDie(), }, }, + { + // a role to use for heapster's connections back to the API server + ObjectMeta: api.ObjectMeta{Name: "system:heapster"}, + Rules: []rbac.PolicyRule{ + rbac.NewRule(Read...).Groups(legacyGroup).Resources("events", "pods", "nodes", "namespaces").RuleOrDie(), + }, + }, { // a role for nodes to use to have the access they need for running pods ObjectMeta: api.ObjectMeta{Name: "system:node"}, diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml index 305169c987a..74b607d1153 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml @@ -388,6 +388,26 @@ items: - /version verbs: - get +- apiVersion: rbac.authorization.k8s.io/v1alpha1 + kind: ClusterRole + metadata: + creationTimestamp: null + labels: + kubernetes.io/bootstrapping: rbac-defaults + name: system:heapster + rules: + - apiGroups: + - "" + attributeRestrictions: null + resources: + - events + - namespaces + - nodes + - pods + verbs: + - get + - list + - watch - apiVersion: rbac.authorization.k8s.io/v1alpha1 kind: ClusterRole metadata: