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

add appropriate RBAC for the role-sync-controller #8608

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

demonCoder95
Copy link
Member

@demonCoder95 demonCoder95 commented Dec 9, 2024

Since we removed the permissions to read Secret objects from the poweruser ClusterRole in #8537 , we can no longer bind this ClusterRole to the role-sync-controller ServiceAccount. This doesn't work anymore:

time="2024-12-09T08:53:00Z" level=error msg="error reconcile Role 'secrets-reader' for Namespace 'authorization-219': failed to create Role 'secrets-reader' in Namespace 'authorization-219': roles.rbac.authorization.k8s.io \"secrets-reader\" is forbidden: user \"system:serviceaccount:kube-system:role-sync-controller\" (groups=[\"system:serviceaccounts\" \"system:serviceaccounts:kube-system\" \"system:authenticated\"]) is attempting to grant RBAC permissions not currently held:\n{APIGroups:[\"\"], Resources:[\"secrets\"], Verbs:[\"get\" \"list\" \"watch\"]}"

This introduces a new ClusterRole intended to be used by the role-sync-controllerand only provides the permissions it needs for syncingsecrets-reader` Role in each namespace.

@demonCoder95 demonCoder95 added the minor Minor changes, e.g. low risk config updates, changes that do not introduce a new API call. label Dec 9, 2024
@demonCoder95
Copy link
Member Author

This change will be a no-op for dev since we enable the role-sync-controller only for the EKS provider. The change is tested in #8588 . Once that succeeds, we can merge this PR.

@demonCoder95
Copy link
Member Author

👍

@demonCoder95
Copy link
Member Author

The test in the other PR now works, we can merge this.

@mikkeloscar
Copy link
Contributor

👍

@mikkeloscar mikkeloscar merged commit bd8e894 into dev Dec 10, 2024
10 checks passed
@mikkeloscar mikkeloscar deleted the update-role-sync-controller-rbac branch December 10, 2024 12:10
This was referenced Dec 10, 2024
@k8s-on-aws-manager-app k8s-on-aws-manager-app bot mentioned this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/alpha merged/beta merged/stable minor Minor changes, e.g. low risk config updates, changes that do not introduce a new API call.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants