-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Avoid copying aggregated admin/edit/view roles during bootstrap #63761
Avoid copying aggregated admin/edit/view roles during bootstrap #63761
Conversation
This pull reminds me. What did we ever doing about irreconcilable differences on rolebindings? /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process Pull Request Labels
|
We've always deleted/recreated if needed: kubernetes/pkg/registry/rbac/reconciliation/reconcile_rolebindings.go Lines 181 to 186 in 773def0
kubernetes/pkg/registry/rbac/reconciliation/reconcile_rolebindings.go Lines 126 to 142 in 773def0
|
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
Fixes #63760
At apiserver startup, prior to reconciling cluster roles, the following roles (if they exist) are copied:
This was added in 1.9 as part of role aggregation to ensure custom permissions added to the admin/edit/view roles were preserved, prior to making the admin/edit/view roles aggregated (since the permissions of an aggregated role are controller-managed)
When starting multiple members of a new HA cluster simultaneously, the following race can occur:
admin
roleadmin
role created by server 1 tosystem:aggregate-to-admin
If this race is encountered, it results in
system:aggregate-to-admin
being an aggregated role, and its permissions subject to being overwritten by the aggregating controller. To prevent this from happening, the permission-preserving copy should only copy over roles that are not yet aggregated.To correct this in clusters that have already encountered it, role reconciliation should remove aggregation from a role that is not expected to be aggregated at all.