WIP: ARO-24037 feat(azure): enable ACR image pulls via Projected SA#8397
WIP: ARO-24037 feat(azure): enable ACR image pulls via Projected SA#8397twolff-gh wants to merge 1 commit intoopenshift:mainfrom
Conversation
…ovider token audience Add ClusterRole and ClusterRoleBinding in the guest cluster granting system:nodes the request-serviceaccounts-token-audience verb. This is required by the ServiceAccountNodeAudienceRestriction feature gate (enabled by default in K8s 1.33+) to authorize kubelet to request projected service account tokens for the api://AzureADTokenExchange audience used by credential providers (KEP-4412). Conditional on Azure (ARO HCP) via azureutil.IsAroHCP(). Ref: ARO-24037 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis change introduces RBAC reconciliation support for node credential provider token audience in the hosted cluster configuration operator. Two new manifest helper functions create 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: twolff-gh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8397 +/- ##
==========================================
+ Coverage 29.94% 34.36% +4.41%
==========================================
Files 1049 1053 +4
Lines 97557 99420 +1863
==========================================
+ Hits 29216 34167 +4951
+ Misses 65837 62603 -3234
- Partials 2504 2650 +146
... and 245 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
RBAC in the guest cluster is the customer's responsibility, not the platform's |
What this PR does / why we need it:
Add RBAC to guest clusters allowing kubelets to request projected service account tokens
for the
api://AzureADTokenExchangeaudience. This is one of the prerequisites forKEP-4412 ACR image pulls via federated workload identity on ARO HCP.
When a pod's ServiceAccount is annotated with ACR credentials, the kubelet requests a
projected SA token from the API server. The token is exchanged with Azure AD via a
federated identity credential on a User-Assigned Managed Identity, which returns an
access token used to pull from private ACR — no pull secrets or node-level identity
attachment required.
The
ServiceAccountNodeAudienceRestrictionadmission controller (enabled by defaultin K8s 1.33+) requires RBAC authorization for the requested audience. Without this
ClusterRole, the token request is denied and the image pull fails. OCP 4.21 ships
K8s 1.34 where KEP-4412 is beta and the kubelet credential provider SA token support
is enabled by default.
Gated behind
azureutil.IsAroHCP()— only applies to managed ARO HCP clusters.References:
Which issue(s) this PR fixes:
Fixes ARO-24037
Special notes for your reviewer:
Test Plan
audience not authorizederrormake testpassesmake buildpassesValidated on personal dev environment: OCP 4.21.9 (K8s 1.34.6), ARO HCP.
Prerequisites
tokenAttributesinjected into worker nodes via MachineConfig (CS-side, not part of this PR)Steps