Skip to content

Commit de45c4e

Browse files
committed
Add HorizontalPodAutoscaler permission for operator role
The HorizontalPodAutoscaler was not added to permission set for the operator Role. The operator during GC operation log the following message: ``` W1106 11:08:59.308067 1 reflector.go:547] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: failed to list *v2.HorizontalPodAutoscaler: horizontalpodautoscalers.autoscaling is forbidden: User "system:serviceaccount:redpanda:redpanda-operator" cannot list resource "horizontalpodautoscalers" in API group "autoscaling" in the namespace "redpanda" E1106 11:08:59.308100 1 reflector.go:150] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: Failed to watch *v2.HorizontalPodAutoscaler: failed to list *v2.HorizontalPodAutoscaler: horizontalpodautoscalers.autoscaling is forbidden: User "system:serviceaccount:redpanda:redpanda-operator" cannot list resource "horizontalpodautoscalers" in API group "autoscaling" in the namespace "redpanda" ```
1 parent 99ca961 commit de45c4e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

charts/operator/rbac.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ func ClusterRole(dot *helmette.Dot) []rbacv1.ClusterRole {
8585
Annotations: values.Annotations,
8686
},
8787
Rules: []rbacv1.PolicyRule{
88+
{
89+
Verbs: []string{"create", "delete", "get", "list", "patch", "update", "watch"},
90+
APIGroups: []string{"autoscaling"},
91+
Resources: []string{"horizontalpodautoscalers"},
92+
},
8893
{
8994
Verbs: []string{"delete", "get", "list", "patch", "update", "watch"},
9095
APIGroups: []string{""},
@@ -476,6 +481,11 @@ func Roles(dot *helmette.Dot) []rbacv1.Role {
476481
Annotations: values.Annotations,
477482
},
478483
Rules: []rbacv1.PolicyRule{
484+
{
485+
Verbs: []string{"create", "delete", "get", "list", "patch", "update", "watch"},
486+
APIGroups: []string{"autoscaling"},
487+
Resources: []string{"horizontalpodautoscalers"},
488+
},
479489
{
480490
Verbs: []string{"delete", "get", "list", "patch", "update", "watch"},
481491
APIGroups: []string{""},

0 commit comments

Comments
 (0)