@@ -65,6 +65,15 @@ type Config struct {
65
65
// It can override the default public ARM endpoint for VMs pool scale operations.
66
66
ARMBaseURLForAPClient string `json:"armBaseURLForAPClient" yaml:"armBaseURLForAPClient"`
67
67
68
+ // Managed system pool configuration for automatic cluster.
69
+ // ManagedSubscriptionID is the subscription ID of the managed resources under AKS internal tenant.
70
+ ManagedSubscriptionID string `json:"managedSubscriptionID" yaml:"managedSubscriptionID"`
71
+ // ManagedResourceGroup is the resource group of the managed resources under AKS internal tenant.
72
+ ManagedResourceGroup string `json:"managedResourceGroup" yaml:"managedResourceGroup"`
73
+ // ManagedResourceProxyURL is the URL to use for retrieving managed resources under AKS internal tenant.
74
+ // It can override the default public ARM endpoint for operations like VM/SKU GET.
75
+ ManagedResourceProxyURL string `json:"managedResourceProxyURL" yaml:"managedResourceProxyURL"`
76
+
68
77
// AuthMethod determines how to authorize requests for the Azure
69
78
// cloud. Valid options are "principal" (= the traditional
70
79
// service principle approach) and "cli" (= load az command line
@@ -223,6 +232,15 @@ func BuildAzureConfig(configReader io.Reader) (*Config, error) {
223
232
if _ , err = assignFromEnvIfExists (& cfg .SubscriptionID , "ARM_SUBSCRIPTION_ID" ); err != nil {
224
233
return nil , err
225
234
}
235
+ if _ , err = assignFromEnvIfExists (& cfg .ManagedResourceProxyURL , "MANAGED_RESOURCE_PROXY_URL" ); err != nil {
236
+ return nil , err
237
+ }
238
+ if _ , err = assignFromEnvIfExists (& cfg .ManagedSubscriptionID , "MANAGED_SUBSCRIPTION_ID" ); err != nil {
239
+ return nil , err
240
+ }
241
+ if _ , err = assignFromEnvIfExists (& cfg .ManagedResourceGroup , "MANAGED_RESOURCE_GROUP" ); err != nil {
242
+ return nil , err
243
+ }
226
244
if _ , err = assignBoolFromEnvIfExists (& cfg .UseManagedIdentityExtension , "ARM_USE_MANAGED_IDENTITY_EXTENSION" ); err != nil {
227
245
return nil , err
228
246
}
@@ -387,6 +405,17 @@ func (cfg *Config) getAzureClientConfig(authorizer autorest.Authorizer, env *azu
387
405
}
388
406
}
389
407
408
+ // A proxy service is required to access resources for the managed system pool within automatic clusters.
409
+ if cfg .ManagedResourceProxyURL != "" {
410
+ azClientConfig .ResourceManagerEndpoint = cfg .ManagedResourceProxyURL
411
+ }
412
+
413
+ // Managed system pool resources are hosted under AKS internal tenant and subscription.
414
+ // it is different from the customer subscription where the cluster is created.
415
+ if cfg .ManagedSubscriptionID != "" {
416
+ azClientConfig .SubscriptionID = cfg .ManagedSubscriptionID
417
+ }
418
+
390
419
return azClientConfig
391
420
}
392
421
0 commit comments