Skip to content

Commit 871a7be

Browse files
Merge branch 'main' into mitryakh/2022-11-01-sdk
2 parents 86ad901 + 58b5a0b commit 871a7be

File tree

21 files changed

+7530
-131
lines changed

21 files changed

+7530
-131
lines changed

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,19 @@ public void TestPodSubnetID()
198198
{
199199
TestRunner.RunTestScript("Test-PodSubnetID");
200200
}
201+
202+
[Fact]
203+
[Trait(Category.AcceptanceType, Category.CheckIn)]
204+
public void TestEnableOidcIssuer()
205+
{
206+
TestRunner.RunTestScript("Test-EnableOidcIssuer");
207+
}
208+
209+
[Fact]
210+
[Trait(Category.AcceptanceType, Category.CheckIn)]
211+
public void TestOutboundType()
212+
{
213+
TestRunner.RunTestScript("Test-OutboundType");
214+
}
201215
}
202216
}

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.ps1

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,4 +1161,55 @@ function Test-PodSubnetID {
11611161
finally {
11621162
Remove-AzResourceGroup -Name $resourceGroupName -Force
11631163
}
1164+
}
1165+
1166+
function Test-EnableOidcIssuer {
1167+
# Setup
1168+
$resourceGroupName = Get-RandomResourceGroupName
1169+
$kubeClusterName1 = Get-RandomClusterName
1170+
$kubeClusterName2 = Get-RandomClusterName
1171+
$location = 'eastus'
1172+
$nodeVmSize = "Standard_D2_v2"
1173+
1174+
try {
1175+
New-AzResourceGroup -Name $resourceGroupName -Location $location
1176+
1177+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1 -NodeVmSize $nodeVmSize -NodeCount 1 -EnableOidcIssuer
1178+
$cluster1 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1
1179+
Assert-True {$cluster1.OidcIssuerProfile.Enabled}
1180+
Assert-True {$cluster1.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}
1181+
1182+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -NodeCount 1
1183+
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
1184+
Assert-False {$cluster2.OidcIssuerProfile.Enabled}
1185+
Assert-Null $cluster2.OidcIssuerProfile.IssuerURL
1186+
1187+
Set-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -EnableOidcIssuer
1188+
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
1189+
Assert-True {$cluster2.OidcIssuerProfile.Enabled}
1190+
Assert-True {$cluster2.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}
1191+
1192+
}
1193+
finally {
1194+
Remove-AzResourceGroup -Name $resourceGroupName -Force
1195+
}
1196+
}
1197+
1198+
function Test-OutboundType {
1199+
# Setup
1200+
$resourceGroupName = Get-RandomResourceGroupName
1201+
$kubeClusterName = Get-RandomClusterName
1202+
$location = 'eastus'
1203+
$nodeVmSize = "Standard_D2_v2"
1204+
1205+
try {
1206+
New-AzResourceGroup -Name $resourceGroupName -Location $location
1207+
1208+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize -NodeCount 1 -OutboundType managedNATGateway
1209+
$cluster = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName
1210+
Assert-AreEqual 'managedNATGateway' $cluster.NetworkProfile.OutboundType
1211+
}
1212+
finally {
1213+
Remove-AzResourceGroup -Name $resourceGroupName -Force
1214+
}
11641215
}

src/Aks/Aks.Test/SessionRecords/Commands.Aks.Test.ScenarioTests.KubernetesTests/TestEnableOidcIssuer.json

Lines changed: 4499 additions & 0 deletions
Large diffs are not rendered by default.

src/Aks/Aks.Test/SessionRecords/Commands.Aks.Test.ScenarioTests.KubernetesTests/TestOutboundType.json

Lines changed: 2578 additions & 0 deletions
Large diffs are not rendered by default.

src/Aks/Aks/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added parameter `-OutboundType` for `New-AzAksCluster`
22+
* Added parameter `-EnableOidcIssuer` for `New-AzAksCluster` and `Set-AzAksCluster`
2123
* Added parameter `-NodePodSubnetID` for `New-AzAksCluster`, `-PodSubnetID` for `New-AzAksNodePool`
2224

2325
## Version 5.3.2

src/Aks/Aks/Commands/NewAzureRmAks.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using Microsoft.Rest;
3232
using Microsoft.WindowsAzure.Commands.Common;
3333
using Microsoft.WindowsAzure.Commands.Utilities.Common;
34+
using Newtonsoft.Json;
3435

3536
namespace Microsoft.Azure.Commands.Aks
3637
{
@@ -111,6 +112,10 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase
111112
[Parameter(Mandatory = false, HelpMessage = "Docker bridge cidr used for building Kubernetes network.")]
112113
public string DockerBridgeCidr { get; set; }
113114

115+
[Parameter(Mandatory = false, HelpMessage = "The outbound (egress) routing method.")]
116+
[PSArgumentCompleter("loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway")]
117+
public string OutboundType { get; set; }
118+
114119
[Parameter(Mandatory = false, HelpMessage = "The load balancer sku for the managed cluster.")]
115120
[PSArgumentCompleter("basic", "standard")]
116121
public string LoadBalancerSku { get; set; }
@@ -179,6 +184,9 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase
179184
[Parameter(Mandatory = false, HelpMessage = "The ID of the subnet which pods will join when launched.")]
180185
public string NodePodSubnetID { get; set; }
181186

187+
[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
188+
public SwitchParameter EnableOidcIssuer { get; set; }
189+
182190
private AcsServicePrincipal acsServicePrincipal;
183191

184192
public override void ExecuteCmdlet()
@@ -429,6 +437,11 @@ private ManagedCluster BuildNewCluster()
429437
managedCluster.ExtendedLocation = new ExtendedLocation(name: EdgeZone, type: "EdgeZone");
430438
}
431439

440+
if (EnableOidcIssuer.IsPresent)
441+
{
442+
managedCluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
443+
}
444+
432445
return managedCluster;
433446
}
434447

@@ -459,6 +472,10 @@ private ContainerServiceNetworkProfile GetNetworkProfile()
459472
{
460473
networkProfile.DockerBridgeCidr = DockerBridgeCidr;
461474
}
475+
if (this.IsParameterBound(c => c.OutboundType))
476+
{
477+
networkProfile.OutboundType = OutboundType;
478+
}
462479
networkProfile.LoadBalancerProfile = CreateOrUpdateLoadBalancerProfile(null);
463480

464481
return networkProfile;

src/Aks/Aks/Commands/SetAzureRmAks.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public class SetAzureRmAks : CreateOrUpdateKubeBase
8080
[Parameter(Mandatory = false, HelpMessage = "Whether to use use Uptime SLA.")]
8181
public SwitchParameter EnableUptimeSLA { get; set; }
8282

83+
[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
84+
public SwitchParameter EnableOidcIssuer { get; set; }
85+
8386
private ManagedCluster BuildNewCluster()
8487
{
8588
BeforeBuildNewCluster();
@@ -420,6 +423,10 @@ public override void ExecuteCmdlet()
420423
{
421424
cluster.AadProfile = AadProfile;
422425
}
426+
if (EnableOidcIssuer.IsPresent)
427+
{
428+
cluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
429+
}
423430
SetIdentity(cluster);
424431

425432
var kubeCluster = this.CreateOrUpdate(ResourceGroupName, Name, cluster);

src/Aks/Aks/help/New-AzAksCluster.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ New-AzAksCluster [-NodeVmSetType <String>] [-NodeVnetSubnetID <String>] [-NodeMa
2323
[-SubnetName <String>] [-EnableRbac] [-WindowsProfileAdminUserName <String>]
2424
[-WindowsProfileAdminUserPassword <SecureString>] [-NetworkPlugin <String>] [-NetworkPolicy <String>]
2525
[-PodCidr <String>] [-ServiceCidr <String>] [-DnsServiceIP <String>] [-DockerBridgeCidr <String>]
26-
[-LoadBalancerSku <String>] [-Force] [-GenerateSshKey] [-EnableNodePublicIp] [-NodePublicIPPrefixID <String>]
27-
[-AvailabilityZone <String[]>] [-NodeResourceGroup <String>] [-EnableEncryptionAtHost] [-EnableUltraSSD]
28-
[-NodeLinuxOSConfig <LinuxOSConfig>] [-NodeKubeletConfig <KubeletConfig>] [-NodeMaxSurge <String>]
29-
[-PPG <String>] [-EnableFIPS] [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>]
30-
[-GpuInstanceProfile <String>] [-EnableUptimeSLA] [-EdgeZone <String>] [-NodeHostGroupID <String>]
31-
[-NodePodSubnetID <String>] [-ResourceGroupName] <String> [-Name] <String>
26+
[-OutboundType <String>] [-LoadBalancerSku <String>] [-Force] [-GenerateSshKey] [-EnableNodePublicIp]
27+
[-NodePublicIPPrefixID <String>] [-AvailabilityZone <String[]>] [-NodeResourceGroup <String>]
28+
[-EnableEncryptionAtHost] [-EnableUltraSSD] [-NodeLinuxOSConfig <LinuxOSConfig>]
29+
[-NodeKubeletConfig <KubeletConfig>] [-NodeMaxSurge <String>] [-PPG <String>] [-EnableFIPS]
30+
[-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-GpuInstanceProfile <String>]
31+
[-EnableUptimeSLA] [-EdgeZone <String>] [-NodeHostGroupID <String>] [-NodePodSubnetID <String>]
32+
[-EnableOidcIssuer] [-ResourceGroupName] <String> [-Name] <String>
3233
[[-ServicePrincipalIdAndSecret] <PSCredential>] [-Location <String>] [-LinuxProfileAdminUserName <String>]
3334
[-DnsNamePrefix <String>] [-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>]
3435
[-NodeMaxCount <Int32>] [-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>]
@@ -501,6 +502,21 @@ Accept pipeline input: False
501502
Accept wildcard characters: False
502503
```
503504
505+
### -EnableOidcIssuer
506+
Whether to enalbe OIDC issuer feature.
507+
508+
```yaml
509+
Type: System.Management.Automation.SwitchParameter
510+
Parameter Sets: (All)
511+
Aliases:
512+
513+
Required: False
514+
Position: Named
515+
Default value: None
516+
Accept pipeline input: False
517+
Accept wildcard characters: False
518+
```
519+
504520
### -EnableRbac
505521
Whether to enable Kubernetes Role-Based Access
506522
@@ -1177,6 +1193,21 @@ Accept pipeline input: False
11771193
Accept wildcard characters: False
11781194
```
11791195
1196+
### -OutboundType
1197+
The outbound (egress) routing method.
1198+
1199+
```yaml
1200+
Type: System.String
1201+
Parameter Sets: (All)
1202+
Aliases:
1203+
1204+
Required: False
1205+
Position: Named
1206+
Default value: None
1207+
Accept pipeline input: False
1208+
Accept wildcard characters: False
1209+
```
1210+
11801211
### -PodCidr
11811212
Pod cidr used for building Kubernetes network.
11821213

src/Aks/Aks/help/Set-AzAksCluster.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Update or create a managed Kubernetes cluster.
1515
### defaultParameterSet (Default)
1616
```
1717
Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImageOnly] [-ControlPlaneOnly]
18-
[-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA]
18+
[-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA] [-EnableOidcIssuer]
1919
[-ResourceGroupName] <String> [-Name] <String> [[-ServicePrincipalIdAndSecret] <PSCredential>]
2020
[-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
2121
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
@@ -38,11 +38,11 @@ Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImag
3838
```
3939
Set-AzAksCluster -InputObject <PSKubernetesCluster> [-NodePoolMode <String>] [-AcrNameToDetach <String>]
4040
[-NodeImageOnly] [-ControlPlaneOnly] [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>]
41-
[-EnableUptimeSLA] [-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
42-
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
43-
[-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>]
44-
[-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>] [-AcrNameToAttach <String>]
45-
[-AsJob] [-Tag <Hashtable>] [-LoadBalancerAllocatedOutboundPort <Int32>]
41+
[-EnableUptimeSLA] [-EnableOidcIssuer] [-Location <String>] [-LinuxProfileAdminUserName <String>]
42+
[-DnsNamePrefix <String>] [-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>]
43+
[-NodeMaxCount <Int32>] [-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>]
44+
[-NodeVmSize <String>] [-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>]
45+
[-AcrNameToAttach <String>] [-AsJob] [-Tag <Hashtable>] [-LoadBalancerAllocatedOutboundPort <Int32>]
4646
[-LoadBalancerManagedOutboundIpCount <Int32>] [-LoadBalancerOutboundIp <String[]>]
4747
[-LoadBalancerOutboundIpPrefix <String[]>] [-LoadBalancerIdleTimeoutInMinute <Int32>]
4848
[-ApiServerAccessAuthorizedIpRange <String[]>] [-EnableApiServerAccessPrivateCluster]
@@ -59,7 +59,7 @@ Set-AzAksCluster -InputObject <PSKubernetesCluster> [-NodePoolMode <String>] [-A
5959
```
6060
Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImageOnly] [-ControlPlaneOnly]
6161
[-Id] <String> [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA]
62-
[-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
62+
[-EnableOidcIssuer] [-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
6363
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
6464
[-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>]
6565
[-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>] [-AcrNameToAttach <String>]
@@ -403,6 +403,21 @@ Accept pipeline input: False
403403
Accept wildcard characters: False
404404
```
405405
406+
### -EnableOidcIssuer
407+
Whether to enalbe OIDC issuer feature.
408+
409+
```yaml
410+
Type: System.Management.Automation.SwitchParameter
411+
Parameter Sets: (All)
412+
Aliases:
413+
414+
Required: False
415+
Position: Named
416+
Default value: None
417+
Accept pipeline input: False
418+
Accept wildcard characters: False
419+
```
420+
406421
### -EnableUptimeSLA
407422
Whether to use use Uptime SLA.
408423

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Updated the breaking change warning in `New-AzVM` and `New-AzVmss` regarding using the new versioned image aliases to indicate that certain aliases will be removed next breaking change release.
2324

2425
## Version 5.7.0
2526
* Addressed bug in `Remove-AzVmss` to throw error when `-InstanceId` is null. [#21162]

0 commit comments

Comments
 (0)