Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Missing list & watch role permissions when watching single namespace #1264

Closed
alexandrevilain opened this issue Jul 25, 2024 · 0 comments · Fixed by #1265
Closed

bug: Missing list & watch role permissions when watching single namespace #1264

alexandrevilain opened this issue Jul 25, 2024 · 0 comments · Fixed by #1265

Comments

@alexandrevilain
Copy link
Contributor

Describe the issue

This is the same issue than: #646 but for roles.

When deploying the chart with a single namespace watched using the --watch-namespaces flag, the operator complains about missing rights:

E0725 09:28:43.406703       1 reflector.go:140] pkg/mod/k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: Failed to watch *v1.Role: failed to list *v1.Role: roles.rbac.authorization.k8s.io is forbidden: User "system:serviceaccount:logging:fluent-operator" cannot list resource "roles" in API group "rbac.authorization.k8s.io" in the namespace "logging"
W0725 09:28:48.261017       1 reflector.go:424] pkg/mod/k8s.io/client-go@v0.26.3/tools/cache/reflector.go:169: failed to list *v1.Role: roles.rbac.authorization.k8s.io is forbidden: User "system:serviceaccount:logging:fluent-operator" cannot list resource "roles" in API group "rbac.authorization.k8s.io" in the namespace "logging" 

To Reproduce

helm install fluent-operator --create-namespace -n fluent charts/fluent-operator/  \
    --set containerRuntime=containerd \
    --set Kubernetes=true \
    --set fluentbit.enable=true \
    --set fluentd.enable=false \
    --set operator.disableComponentControllers=fluentd \
    --set operator.extraArgs={--watch-namespaces=fluent}

Expected behavior

The helm chart should have the following rbac rules:

  - apiGroups:
      - rbac.authorization.k8s.io
    resources:
      - rolebindings
    verbs:
      - create
      - list
      - get
      - watch
      - patch
  - apiGroups:
      - rbac.authorization.k8s.io
    resources:
      - roles
    verbs:
      - create
      - list
      - get
      - watch
      - patch

Your Environment

- Fluent Operator version: 3.0.0
- Container Runtime:
- Operating system:
- Kernel version:

How did you install fluent operator?

See how to reproduce.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant