Change import role to cluster role #2645
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reduces the dynamically created roles. It should result in a about two less roles per cluster. Import service accounts, roles and bindings are only required for the cluster import and are cleaned up.
Upgrading existing Clusters to the new ClusterRoles
To migrate existing clusters, it should be enough to delete the
ClusterRegistrationToken
to get rid of the old import service accounts and roles/rolebindings. The ClusterRegistrationToken usually has a TTL of 12h, after which it is deleted.The sa, roles and rolebindings are recreated automatically, if the agent re-registers. However, an old ClusterRegistrationToken and it's RBAC resources will break that.