feat: add multi-subscription support for AzureNodeClass#1580
Draft
comtalyst wants to merge 2 commits intocomtalyst/azurenodeclass-v4from
Draft
feat: add multi-subscription support for AzureNodeClass#1580comtalyst wants to merge 2 commits intocomtalyst/azurenodeclass-v4from
comtalyst wants to merge 2 commits intocomtalyst/azurenodeclass-v4from
Conversation
bf471b3 to
eaa8e44
Compare
ba1fd8b to
4571be4
Compare
eaa8e44 to
822bc0c
Compare
08a4b7d to
2b75465
Compare
Add per-NodeClass subscription, resource group, and location overrides so VMs can be provisioned across multiple Azure subscriptions from a single Karpenter controller. This enables scenarios where workloads need VMs in different subscriptions or regions while sharing one control plane. Changes: - Add SubscriptionID, ResourceGroup, Location fields to AzureNodeClassSpec with getter methods and deepcopy support - Create AZClientManager that lazily creates and caches per-subscription Azure SDK clients (VM, NIC, extensions) using a shared TokenCredential - Wire AZClientManager into DefaultVMProvider; beginLaunchAzureVM now resolves effective sub/RG/location from NodeClass overrides with fallback to controller-level defaults - Add createSimpleNICWithClients and createVirtualMachineWithClients variants that accept explicit client + resource group parameters - Update cleanup path (BeginCreateAzureVM error handling) to use per-subscription clients for correct resource cleanup - Update operator.go and test environment to construct AZClientManager The identity backing the controller must have RBAC across all target subscriptions. When no overrides are set, behavior is identical to before (default subscription clients are reused without extra allocation). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bnet validation Three features for AzureNodeClass multi-subscription support: 1. Per-NodeClass Managed Identities: Add managedIdentities field to AzureNodeClassSpec that merges with global --node-identities flag. Case-insensitive ARM resource ID deduplication ensures no conflicts. 2. Multi-subscription List/Get/Delete: VMs created in non-default subscriptions are now visible to lifecycle operations. Tracks known subscription+RG pairs from Create, then queries all known subs in List (via ARG), Get (fallback search), Delete (fallback cleanup), GetNic, ListNics, and DeleteNic. 3. AzureNodeClass Subnet Validation: Status controller now validates VNETSubnetID exists, with cross-subscription support via AZClientManager. Adds SubnetsReady condition and SubnetsClient to SubscriptionClients. Exposes AZClientManager on the Operator struct. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
822bc0c to
fa95176
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds per-NodeClass subscription, resource group, and location overrides for AzureNodeClass, enabling VM creation across multiple Azure subscriptions.
subscriptionID,resourceGroup,locationfields on AzureNodeClass CRDAZClientManager: lazily creates and caches per-subscription Azure SDK clients (VM, NIC, extensions) using a sharedTokenCredentialbeginLaunchAzureVMresolves effective sub/RG/location from NodeClass overrides with controller-level fallbackscreateSimpleNICWithClientsandcreateVirtualMachineWithClientsStacks on PR #1579.
Test plan
go build && go vetpass🤖 Generated with Claude Code