Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Aks/Aks.Test/ScenarioTests/KubernetesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,12 @@ public void TestPodSubnetID()
{
TestRunner.RunTestScript("Test-PodSubnetID");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestEnableOidcIssuer()
{
TestRunner.RunTestScript("Test-EnableOidcIssuer");
}
}
}
32 changes: 32 additions & 0 deletions src/Aks/Aks.Test/ScenarioTests/KubernetesTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1161,4 +1161,36 @@ function Test-PodSubnetID {
finally {
Remove-AzResourceGroup -Name $resourceGroupName -Force
}
}

function Test-EnableOidcIssuer {
# Setup
$resourceGroupName = Get-RandomResourceGroupName
$kubeClusterName1 = Get-RandomClusterName
$kubeClusterName2 = Get-RandomClusterName
$location = 'eastus'
$nodeVmSize = "Standard_D2_v2"

try {
New-AzResourceGroup -Name $resourceGroupName -Location $location

New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1 -NodeVmSize $nodeVmSize -NodeCount 1 -EnableOidcIssuer
$cluster1 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1
Assert-True {$cluster1.OidcIssuerProfile.Enabled}
Assert-True {$cluster1.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}

New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -NodeCount 1
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
Assert-False {$cluster2.OidcIssuerProfile.Enabled}
Assert-Null $cluster2.OidcIssuerProfile.IssuerURL

Set-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -EnableOidcIssuer
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
Assert-True {$cluster2.OidcIssuerProfile.Enabled}
Assert-True {$cluster2.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}

}
finally {
Remove-AzResourceGroup -Name $resourceGroupName -Force
}
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Aks/Aks/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added parameter `-EnableOidcIssuer` for `New-AzAksCluster` and `Set-AzAksCluster`
* Added parameter `-NodePodSubnetID` for `New-AzAksCluster`, `-PodSubnetID` for `New-AzAksNodePool`

## Version 5.3.2
Expand Down
8 changes: 8 additions & 0 deletions src/Aks/Aks/Commands/NewAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase
[Parameter(Mandatory = false, HelpMessage = "The ID of the subnet which pods will join when launched.")]
public string NodePodSubnetID { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
public SwitchParameter EnableOidcIssuer { get; set; }

private AcsServicePrincipal acsServicePrincipal;

public override void ExecuteCmdlet()
Expand Down Expand Up @@ -429,6 +432,11 @@ private ManagedCluster BuildNewCluster()
managedCluster.ExtendedLocation = new ExtendedLocation(name: EdgeZone, type: "EdgeZone");
}

if (EnableOidcIssuer.IsPresent)
{
managedCluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
}

return managedCluster;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Aks/Aks/Commands/SetAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public class SetAzureRmAks : CreateOrUpdateKubeBase
[Parameter(Mandatory = false, HelpMessage = "Whether to use use Uptime SLA.")]
public SwitchParameter EnableUptimeSLA { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
public SwitchParameter EnableOidcIssuer { get; set; }

private ManagedCluster BuildNewCluster()
{
BeforeBuildNewCluster();
Expand Down Expand Up @@ -420,6 +423,10 @@ public override void ExecuteCmdlet()
{
cluster.AadProfile = AadProfile;
}
if (EnableOidcIssuer.IsPresent)
{
cluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
}
SetIdentity(cluster);

var kubeCluster = this.CreateOrUpdate(ResourceGroupName, Name, cluster);
Expand Down
17 changes: 16 additions & 1 deletion src/Aks/Aks/help/New-AzAksCluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ New-AzAksCluster [-NodeVmSetType <String>] [-NodeVnetSubnetID <String>] [-NodeMa
[-NodeLinuxOSConfig <LinuxOSConfig>] [-NodeKubeletConfig <KubeletConfig>] [-NodeMaxSurge <String>]
[-PPG <String>] [-EnableFIPS] [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>]
[-GpuInstanceProfile <String>] [-EnableUptimeSLA] [-EdgeZone <String>] [-NodeHostGroupID <String>]
[-NodePodSubnetID <String>] [-ResourceGroupName] <String> [-Name] <String>
[-NodePodSubnetID <String>] [-EnableOidcIssuer] [-ResourceGroupName] <String> [-Name] <String>
[[-ServicePrincipalIdAndSecret] <PSCredential>] [-Location <String>] [-LinuxProfileAdminUserName <String>]
[-DnsNamePrefix <String>] [-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>]
[-NodeMaxCount <Int32>] [-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>]
Expand Down Expand Up @@ -501,6 +501,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableOidcIssuer
Whether to enalbe OIDC issuer feature.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableRbac
Whether to enable Kubernetes Role-Based Access

Expand Down
29 changes: 22 additions & 7 deletions src/Aks/Aks/help/Set-AzAksCluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Update or create a managed Kubernetes cluster.
### defaultParameterSet (Default)
```
Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImageOnly] [-ControlPlaneOnly]
[-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA]
[-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA] [-EnableOidcIssuer]
[-ResourceGroupName] <String> [-Name] <String> [[-ServicePrincipalIdAndSecret] <PSCredential>]
[-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
Expand All @@ -38,11 +38,11 @@ Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImag
```
Set-AzAksCluster -InputObject <PSKubernetesCluster> [-NodePoolMode <String>] [-AcrNameToDetach <String>]
[-NodeImageOnly] [-ControlPlaneOnly] [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>]
[-EnableUptimeSLA] [-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
[-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>]
[-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>] [-AcrNameToAttach <String>]
[-AsJob] [-Tag <Hashtable>] [-LoadBalancerAllocatedOutboundPort <Int32>]
[-EnableUptimeSLA] [-EnableOidcIssuer] [-Location <String>] [-LinuxProfileAdminUserName <String>]
[-DnsNamePrefix <String>] [-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>]
[-NodeMaxCount <Int32>] [-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>]
[-NodeVmSize <String>] [-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>]
[-AcrNameToAttach <String>] [-AsJob] [-Tag <Hashtable>] [-LoadBalancerAllocatedOutboundPort <Int32>]
[-LoadBalancerManagedOutboundIpCount <Int32>] [-LoadBalancerOutboundIp <String[]>]
[-LoadBalancerOutboundIpPrefix <String[]>] [-LoadBalancerIdleTimeoutInMinute <Int32>]
[-ApiServerAccessAuthorizedIpRange <String[]>] [-EnableApiServerAccessPrivateCluster]
Expand All @@ -59,7 +59,7 @@ Set-AzAksCluster -InputObject <PSKubernetesCluster> [-NodePoolMode <String>] [-A
```
Set-AzAksCluster [-NodePoolMode <String>] [-AcrNameToDetach <String>] [-NodeImageOnly] [-ControlPlaneOnly]
[-Id] <String> [-AutoScalerProfile <ManagedClusterPropertiesAutoScalerProfile>] [-EnableUptimeSLA]
[-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
[-EnableOidcIssuer] [-Location <String>] [-LinuxProfileAdminUserName <String>] [-DnsNamePrefix <String>]
[-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>] [-NodeMaxCount <Int32>]
[-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>] [-NodeVmSize <String>]
[-NodePoolLabel <Hashtable>] [-NodePoolTag <Hashtable>] [-SshKeyValue <String>] [-AcrNameToAttach <String>]
Expand Down Expand Up @@ -403,6 +403,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableOidcIssuer
Whether to enalbe OIDC issuer feature.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableUptimeSLA
Whether to use use Uptime SLA.

Expand Down