feat: move role assignments to Azure Deployment Stacks and introduce Identity Replacement support #8186
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.66) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 354 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.351
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #8186"
general
weight: 0.35
miguelsorianod
This PR changes the role assignments over mrg controller replacing it by controllers that performs the creation of the role assignments of the different identities specified in the Cluster's CustomerProperties.Platform.OperatorsAuthentication.UserAssignedIdentities section (which includes control plane operators, data plane operators and the cluster's service managed identity) with two relevant changes:
Management of them through Azure Deployment Stacks
Identity replacement support
Regarding identity replacement support:
It replaces the previously existing role assignments controller, adding support for the full lifecycle (create, update, delete instead of just create,update), as well as identities replacement support.
The controllers attempts to support identity replacement, which can be triggered in two different ways:
Triggered by the end-user by interacting with the RP API by changing the operator->identity association
Triggered by the actual identity behind the resourceid associated to it changing. For example, because it's been deleted and recreated with the same resourceid. There is no end-user's RP API interaction in that case
The implementation also takes into account a single identity being used in N operators at the same time. Even across cp, dp operators and service managed identity. This is because soon we will implement identity reuse support too.
The implementation also takes into account that there can be chained replacement transitions where some of the transitions might not be fully completed before the next one is specified. For example, an identity being replaced for an operator from A -> B -> C and identity C being specified for the operator before the A->B replacement transition completed. This includes performing deconfiguration/cleanup process of those previous replacement transitions, including the partial ones.
There is currently a limitation we have which is that Hypershift does not currently report whether an identity is actually being used by an operator, neither the replacement process status. Immediately deconfiguring an old replaced identity would cause disruption to the service as the identity replacement process takes a while to occur and propagate since its specified in the Hypershift HostedCluster until it ends up being used in the actual operators, and the operators stop using the old one. Because of this, as a best-effort until we have that state reporting, we do not initiate the actual deconfiguration process until 24h after we detected it shouldn't be in-use anymore because of a identity replacement occurring
The implementation also provides a way for external controllers to determine "have all the role assignments over the managed resource group been created/configured for this identity used by this operator"? so they can gate on it.