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

Investigate need for kyma-system and istio-system RoleBindings to klm-manager-role ClusterRole #1613

Closed
4 of 5 tasks
c-pius opened this issue Jun 6, 2024 · 1 comment · Fixed by #1722
Closed
4 of 5 tasks
Assignees
Labels
area/quality Related to all activites around quality kind/feature Categorizes issue or PR as related to a new feature.

Comments

@c-pius
Copy link
Contributor

c-pius commented Jun 6, 2024

Description

As of now we have three bindings to klm-manager-role ClusterRole for kcp-system, kyma-system and istio-system namespaces: https://github.com/kyma-project/lifecycle-manager/blob/main/config/rbac/namespace_bindings/role_binding.yaml

While testing the helm setup, we tried to remove the ones for kyma-system and istio-system, but this leads to errors like:

klm-controller-manager-7d846d6545-5hqq9 manager W0605 12:53:04.754801       1 reflector.go:539] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:229: failed to list *v1beta2.Watcher: watchers.operator.kyma-project.io is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "watchers" in API group "operator.kyma-project.io" at the cluster scope
klm-controller-manager-7d846d6545-5hqq9 manager E0605 12:53:04.754828       1 reflector.go:147] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:229: Failed to watch *v1beta2.Watcher: failed to list *v1beta2.Watcher: watchers.operator.kyma-project.io is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "watchers" in API group "operator.kyma-project.io" at the cluster scope

Those errors are surprising because KLM should be working in kcp-system namespace on KCP, and kyma-system namespace only on SKR which is accessed through the related kubeconfig file.

We need to find out why those bindings are needed and if it can be reduced to not need those anymore.

Reasons

Keeping RBAC as restricted and clean as possible

Acceptance Criteria

  • Time-boxed Research One day:
    • Check what the current behaviour of KLM is if we remove corresponding RoleBindings
    • Find the reasoning if KLM has errors
    • Propose possible solutions to the team
  • Create Follow-Up issue

Feature Testing

No response

Testing approach

No response

Attachments

No response

@c-pius c-pius added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 6, 2024
@nesmabadr nesmabadr self-assigned this Jul 25, 2024
@nesmabadr
Copy link
Contributor

The errors shown are specific to the namespaces:

Failed to watch *v1beta2.ModuleTemplate: failed to list *v1beta2.ModuleTemplate: moduletemplates.operator.kyma-project.io is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "moduletemplates" in API group "operator.kyma-project.io" in the namespace "kyma-system"                             ││ klm-controller-manager-8c89c9759-7t729 W0725 18:54:21.745617       1 reflector.go:547] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: failed to list *v1beta2.Kyma: kymas.operator.kyma-project.io is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "kymas" in API group "operator.kyma-project.io" in the namespace "kyma-system"                                                                                                    ││ klm-controller-manager-8c89c9759-7t729 E0725 18:54:21.745979       1 reflector.go:150] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: Failed to watch *v1beta2.Kyma: failed to list *v1beta2.Kyma: kymas.operator.kyma-project.io is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "kymas" in API group "operator.kyma-project.io" in the namespace "kyma-system"                                                                     │
│ klm-controller-manager-8c89c9759-7t729 W0725 18:54:27.603816       1 reflector.go:547] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: failed to list *v1.Secret: secrets is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "secrets" in API group "" in the namespace "kyma-system"                                                                                                                                                    │
│ klm-controller-manager-8c89c9759-7t729 E0725 18:54:27.604167       1 reflector.go:150] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: Failed to watch *v1.Secret: failed to list *v1.Secret: secrets is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "secrets" in API group "" in the namespace "kyma-system"                                                                                                                        │
│ klm-controller-manager-8c89c9759-7t729 W0725 18:54:37.570212       1 reflector.go:547] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: failed to list *v1.Secret: secrets is forbidden: User "system:serviceaccount:kcp-system:klm-controller-manager" cannot list resource "secrets" in API group "" in the namespace "istio-system"

@nesmabadr nesmabadr removed their assignment Jul 29, 2024
@nesmabadr nesmabadr reopened this Aug 1, 2024
@c-pius c-pius assigned nesmabadr and c-pius and unassigned ruanxin Aug 2, 2024
@c-pius c-pius added the area/quality Related to all activites around quality label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/quality Related to all activites around quality kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants