Skip to content

Commit e7c9a6f

Browse files
authored
Merge branch 'main' into yeming/rs
2 parents 86e2e58 + da49e79 commit e7c9a6f

File tree

2,586 files changed

+275084
-117669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,586 files changed

+275084
-117669
lines changed

src/Accounts/Accounts/Utilities/CommandMappings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,6 +4009,18 @@
40094009
"New-AzNetworkManagerSecurityAdminRule": {},
40104010
"Remove-AzNetworkManagerSecurityAdminRule": {},
40114011
"Set-AzNetworkManagerSecurityAdminRule": {},
4012+
"Get-AzNetworkManagerSecurityUserConfiguration": {},
4013+
"New-AzNetworkManagerSecurityUserConfiguration": {},
4014+
"Remove-AzNetworkManagerSecurityUserConfiguration": {},
4015+
"Set-AzNetworkManagerSecurityUserConfiguration": {},
4016+
"Get-AzNetworkManagerSecurityUserRuleCollection": {},
4017+
"New-AzNetworkManagerSecurityUserRuleCollection": {},
4018+
"Remove-AzNetworkManagerSecurityUserRuleCollection": {},
4019+
"Set-AzNetworkManagerSecurityUserRuleCollection": {},
4020+
"Get-AzNetworkManagerSecurityUserRule": {},
4021+
"New-AzNetworkManagerSecurityUserRule": {},
4022+
"Remove-AzNetworkManagerSecurityUserRule": {},
4023+
"Set-AzNetworkManagerSecurityUserRule": {},
40124024
"Get-AzNetworkManagerActiveConnectivityConfiguration": {},
40134025
"Get-AzNetworkManagerActiveSecurityAdminRule": {},
40144026
"Get-AzNetworkManagerEffectiveConnectivityConfiguration": {},

src/Accounts/Accounts/help/Get-AzSubscription.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ current account.
6464

6565
### Example 3: Get all subscriptions in the current tenant
6666
```powershell
67-
Get-AzSubscription
67+
Get-AzSubscription -TenantId (Get-AzContext).Tenant
6868
```
6969

7070
```Output

src/Aks/Aks/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
* Added support of `FQDN` in `Import-AzAksCredential` [#17711]
2222
* Added hint when `Import-AzAksCredential` meets bad formatted kubernetes configuration file [#16741]
2323
* Added parameter `-NodeResourceGroup` for `New-AzAksCluster`. [#19014]
24+
* Added support for `Auto Upgrade` in `New-AzAksCluster` and `Set-AzAksCluster`.
25+
* Added support for `Http Proxy` in `New-AzAksCluster` and `Set-AzAksCluster`.
26+
* Added parameter `DisableLocalAccount` and `DiskEncryptionSetID` in `New-AzAksCluster` and `Set-AzAksCluster`.
2427

2528
## Version 4.2.1
2629
* Removed the warning messages for MSGraph migration [#18856]

src/Aks/Aks/Commands/CreateOrUpdateKubeBase.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,28 @@ public abstract class CreateOrUpdateKubeBase : KubeCmdletBase
164164
[Parameter(Mandatory = false, HelpMessage = "ResourceId of user assign managed identity for cluster.")]
165165
public string AssignIdentity { get; set; }
166166

167+
[Parameter(Mandatory = false, HelpMessage = "The upgrade channel for auto upgrade. For more information see https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel.")]
168+
[PSArgumentCompleter("rapid", "stable", "patch", "node-image", "none")]
169+
public string AutoUpgradeChannel { get; set; }
170+
171+
[Parameter(Mandatory = false, HelpMessage = "The resource ID of the disk encryption set to use for enabling encryption.")]
172+
public string DiskEncryptionSetID { get; set; }
173+
174+
[Parameter(Mandatory = false, HelpMessage = "Local accounts should be disabled on the Managed Cluster.")]
175+
public SwitchParameter DisableLocalAccount { get; set; }
176+
177+
[Parameter(Mandatory = false, HelpMessage = "The HTTP proxy server endpoint to use.")]
178+
public string HttpProxy { get; set; }
179+
180+
[Parameter(Mandatory = false, HelpMessage = "The HTTPS proxy server endpoint to use")]
181+
public string HttpsProxy { get; set; }
182+
183+
[Parameter(Mandatory = false, HelpMessage = "The endpoints that should not go through proxy.")]
184+
public string[] HttpProxyConfigNoProxyEndpoint { get; set; }
185+
186+
[Parameter(Mandatory = false, HelpMessage = "Alternative CA cert to use for connecting to proxy servers.")]
187+
public string HttpProxyConfigTrustedCa { get; set; }
188+
167189
protected void BeforeBuildNewCluster()
168190
{
169191
if (!string.IsNullOrEmpty(ResourceGroupName) && string.IsNullOrEmpty(Location))
@@ -528,6 +550,49 @@ protected ManagedClusterLoadBalancerProfile CreateOrUpdateLoadBalancerProfile(Ma
528550
return loadBalancerProfile;
529551
}
530552

553+
protected ManagedClusterAutoUpgradeProfile CreateOrUpdateAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile)
554+
{
555+
if (this.IsParameterBound(c => c.AutoUpgradeChannel) && autoUpgradeProfile == null)
556+
{
557+
autoUpgradeProfile = new ManagedClusterAutoUpgradeProfile();
558+
}
559+
if (this.IsParameterBound(c => c.AutoUpgradeChannel))
560+
{
561+
autoUpgradeProfile.UpgradeChannel = AutoUpgradeChannel;
562+
}
563+
return autoUpgradeProfile;
564+
}
565+
566+
protected ManagedClusterHTTPProxyConfig CreateOrUpdateHttpProxyConfig(ManagedClusterHTTPProxyConfig httpProxyConfig)
567+
{
568+
if ((this.IsParameterBound(c => c.HttpProxy) ||
569+
this.IsParameterBound(c => c.HttpsProxy) ||
570+
this.IsParameterBound(c => c.HttpProxyConfigNoProxyEndpoint) ||
571+
this.IsParameterBound(c => c.HttpProxyConfigTrustedCa)) &&
572+
httpProxyConfig == null)
573+
{
574+
httpProxyConfig = new ManagedClusterHTTPProxyConfig();
575+
}
576+
if (this.IsParameterBound(c => c.HttpProxy))
577+
{
578+
httpProxyConfig.HttpProxy = HttpProxy;
579+
}
580+
if (this.IsParameterBound(c => c.HttpsProxy))
581+
{
582+
httpProxyConfig.HttpsProxy = HttpsProxy;
583+
}
584+
if (this.IsParameterBound(c => c.HttpProxyConfigNoProxyEndpoint))
585+
{
586+
httpProxyConfig.NoProxy = HttpProxyConfigNoProxyEndpoint;
587+
}
588+
if (this.IsParameterBound(c => c.HttpProxyConfigTrustedCa))
589+
{
590+
httpProxyConfig.TrustedCa = HttpProxyConfigTrustedCa;
591+
}
592+
593+
return httpProxyConfig;
594+
}
595+
531596
protected ManagedClusterAPIServerAccessProfile CreateOrUpdateApiServerAccessProfile(ManagedClusterAPIServerAccessProfile apiServerAccessProfile)
532597
{
533598
if ((this.IsParameterBound(c => c.ApiServerAccessAuthorizedIpRange) ||

src/Aks/Aks/Commands/NewAzureRmAks.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ private ManagedCluster BuildNewCluster()
343343

344344
var apiServerAccessProfile = CreateOrUpdateApiServerAccessProfile(null);
345345

346+
var httpProxyConfig = CreateOrUpdateHttpProxyConfig(null);
347+
348+
var autoUpgradeProfile = CreateOrUpdateAutoUpgradeProfile(null);
349+
346350
var addonProfiles = CreateAddonsProfiles();
347351

348352
WriteVerbose(string.Format(Resources.DeployingYourManagedKubeCluster, AcsSpFilePath));
@@ -361,7 +365,9 @@ private ManagedCluster BuildNewCluster()
361365
aadProfile: aadProfile,
362366
addonProfiles: addonProfiles,
363367
networkProfile: networkProfile,
364-
apiServerAccessProfile: apiServerAccessProfile);
368+
apiServerAccessProfile: apiServerAccessProfile,
369+
httpProxyConfig: httpProxyConfig,
370+
autoUpgradeProfile: autoUpgradeProfile);
365371

366372
SetIdentity(managedCluster);
367373

@@ -373,6 +379,14 @@ private ManagedCluster BuildNewCluster()
373379
{
374380
managedCluster.FqdnSubdomain = FqdnSubdomain;
375381
}
382+
if (this.IsParameterBound(c => c.DiskEncryptionSetID))
383+
{
384+
managedCluster.DiskEncryptionSetID = DiskEncryptionSetID;
385+
}
386+
if (DisableLocalAccount.IsPresent)
387+
{
388+
managedCluster.DisableLocalAccounts = DisableLocalAccount;
389+
}
376390
//if(EnablePodSecurityPolicy.IsPresent)
377391
//{
378392
// managedCluster.EnablePodSecurityPolicy = EnablePodSecurityPolicy;

src/Aks/Aks/Commands/SetAzureRmAks.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ public override void ExecuteCmdlet()
376376
}
377377
cluster.NetworkProfile = SetNetworkProfile(cluster.NetworkProfile);
378378
cluster.ApiServerAccessProfile = CreateOrUpdateApiServerAccessProfile(cluster.ApiServerAccessProfile);
379+
cluster.HttpProxyConfig = CreateOrUpdateHttpProxyConfig(cluster.HttpProxyConfig);
380+
cluster.AutoUpgradeProfile = CreateOrUpdateAutoUpgradeProfile(cluster.AutoUpgradeProfile);
379381
if (this.IsParameterBound(c => c.FqdnSubdomain))
380382
{
381383
cluster.FqdnSubdomain = FqdnSubdomain;
@@ -384,6 +386,15 @@ public override void ExecuteCmdlet()
384386

385387
var kubeCluster = Client.ManagedClusters.CreateOrUpdate(ResourceGroupName, Name, cluster);
386388

389+
if (this.IsParameterBound(c => c.DiskEncryptionSetID))
390+
{
391+
cluster.DiskEncryptionSetID = DiskEncryptionSetID;
392+
}
393+
if (DisableLocalAccount.IsPresent)
394+
{
395+
cluster.DisableLocalAccounts = DisableLocalAccount;
396+
}
397+
387398
WriteObject(PSMapper.Instance.Map<PSKubernetesCluster>(kubeCluster));
388399
});
389400
}

src/Aks/Aks/Models/Mapper.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ static PSMapper()
4747
cfg.CreateMap<ManagedClusterPoolUpgradeProfileUpgradesItem,PSManagedClusterPoolUpgradeProfileUpgradesItem>().ReverseMap();
4848
cfg.CreateMap<ManagedClusterUpgradeProfile,PSManagedClusterUpgradeProfile>().ReverseMap();
4949
cfg.CreateMap<ManagedClusterWindowsProfile, PSManagedClusterWindowsProfile>().ReverseMap();
50+
cfg.CreateMap<ManagedClusterAutoUpgradeProfile, PSManagedClusterAutoUpgradeProfile>().ReverseMap();
51+
cfg.CreateMap<ManagedClusterHTTPProxyConfig, PSManagedClusterHTTPProxyConfig>().ReverseMap();
52+
cfg.CreateMap<ManagedClusterPodIdentity, PSManagedClusterPodIdentity>().ReverseMap();
53+
cfg.CreateMap<ManagedClusterPodIdentityException, PSManagedClusterPodIdentityException>().ReverseMap();
54+
cfg.CreateMap<ManagedClusterPodIdentityProfile, PSManagedClusterPodIdentityProfile>().ReverseMap();
55+
cfg.CreateMap<UserAssignedIdentity, PSManagedClusterPodIdentityProfileUserAssignedIdentity>().ReverseMap();
56+
cfg.CreateMap<ManagedClusterPodIdentityProvisioningError, PSManagedClusterPodIdentityProvisioningError>().ReverseMap();
57+
cfg.CreateMap<ManagedClusterPodIdentityProvisioningErrorBody, PSManagedClusterPodIdentityProvisioningErrorBody>().ReverseMap();
58+
cfg.CreateMap<ManagedClusterPodIdentityProvisioningInfo, PSManagedClusterPodIdentityProvisioningInfo>().ReverseMap();
59+
cfg.CreateMap<ManagedClusterPropertiesAutoScalerProfile, PSManagedClusterAutoScalerProfile>().ReverseMap();
5060
cfg.CreateMap<Resource,PSResource>().ReverseMap();
5161
cfg.CreateMap<ResourceIdentityType, PSResourceIdentityType>().ReverseMap();
5262
cfg.CreateMap<AgentPool, PSNodePool>().ReverseMap();

src/Aks/Aks/Models/PSKubernetesCluster.cs

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public class PSKubernetesCluster : PSResource
9494
/// </summary>
9595
public string DnsPrefix { get; set; }
9696

97+
/// <summary>
98+
/// Gets or sets the FQDN subdomain of the private cluster with custom private dns.
99+
/// </summary>
100+
public string FqdnSubdomain { get; set; }
101+
97102
/// <summary>
98103
/// Gets FQDN for the master pool.
99104
/// </summary>
@@ -104,6 +109,13 @@ public class PSKubernetesCluster : PSResource
104109
/// </summary>
105110
public string PrivateFQDN { get; private set; }
106111

112+
/// <summary>
113+
/// Gets the special FQDN used by the Azure Portal to access the Managed Cluster.
114+
/// This FQDN is for use only by the Azure Portal and should not be used by other
115+
/// clients.
116+
/// </summary>
117+
public string AzurePortalFQDN { get; private set; }
118+
107119
/// <summary>
108120
/// Gets or sets properties of the agent pool.
109121
/// </summary>
@@ -120,6 +132,11 @@ public class PSKubernetesCluster : PSResource
120132
/// </summary>
121133
public IDictionary<string, PSManagedClusterAddonProfile> AddonProfiles { get; set; }
122134

135+
/// <summary>
136+
/// Gets or sets the pod identity profile of the Managed Cluster.
137+
/// </summary>
138+
public PSManagedClusterPodIdentityProfile PodIdentityProfile { get; set; }
139+
123140
/// <summary>
124141
/// Gets or sets name of the resource group containing agent pool
125142
/// nodes.
@@ -147,17 +164,43 @@ public class PSKubernetesCluster : PSResource
147164
/// Gets or sets profile of Azure Active Directory configuration.
148165
/// </summary>
149166
public PSManagedClusterAadProfile AadProfile { get; set; }
167+
168+
/// <summary>
169+
/// Gets or sets the auto upgrade configuration.
170+
/// </summary>
171+
public PSManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; }
172+
173+
/// <summary>
174+
/// Gets or sets parameters to be applied to the cluster-autoscaler when enabled
175+
/// </summary>
176+
public PSManagedClusterAutoScalerProfile AutoScalerProfile;
177+
178+
/// <summary>
179+
/// Gets or sets the Resource ID of the disk encryption set to use for enabling encryption
180+
/// at rest.
181+
/// </summary>
182+
public string DiskEncryptionSetID { get; set; }
150183

151184
/// <summary>
152185
/// Gets or sets access profile for managed cluster API server.
153186
/// </summary>
154187
public PSManagedClusterAPIServerAccessProfile ApiServerAccessProfile { get; set; }
155188

156-
//
157-
// Summary:
158-
// Gets or sets identities associated with the cluster.
189+
/// <summary>
190+
/// Gets or sets identities associated with the cluster.
191+
/// </summary>
159192
public IDictionary<string, PSManagedClusterPropertiesIdentityProfile> IdentityProfile { get; set; }
160193

194+
/// <summary>
195+
/// Gets or sets if local accounts should be disabled on the Managed Cluster.
196+
/// </summary>
197+
public bool? DisableLocalAccounts { get; set; }
198+
199+
/// <summary>
200+
/// Gets or sets configurations for provisioning the cluster with HTTP proxy servers.
201+
/// </summary>
202+
public PSManagedClusterHTTPProxyConfig HttpProxyConfig { get; set; }
203+
161204
/// <summary>
162205
/// Gets or sets the identity of the managed cluster, if configured.
163206
/// </summary>

0 commit comments

Comments
 (0)