-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[AKS] Use AAD auth by default for AKS addons #29422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,22 +212,23 @@ function Test-EnableAndDisableAzAksAddons | |
| { | ||
| New-AzResourceGroup -Name $resourceGroupName -Location 'eastus' | ||
|
|
||
| $cluster = New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize | ||
| $cluster = New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize -GenerateSshKey | ||
| Assert-Null $cluster.AddonProfiles | ||
|
|
||
| $cluster = $cluster | Enable-AzAksAddon -Name AzurePolicy | ||
| Assert-AreEqual $true $cluster.AddonProfiles['azurepolicy'].Enabled | ||
| $cluster = $cluster | Disable-AzAksAddon -Name AzurePolicy | ||
| Assert-AreEqual $false $cluster.AddonProfiles['azurepolicy'].Enabled | ||
|
|
||
| $cluster2 = New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -NodeVmSize $nodeVmSize | ||
| $cluster2 = New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -NodeVmSize $nodeVmSize -GenerateSshKey | ||
|
||
| Assert-Null $cluster2.AddonProfiles | ||
| #$workspace = New-AzOperationalInsightsWorkspace -Location $location -Name 'akstestws' -ResourceGroupName $resourceGroupName | ||
| #$workspaceId = $workspace.ResourceId | ||
| $workspaceId = '/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/AKS_TEST_RG/providers/Microsoft.OperationalInsights/workspaces/akstestws' | ||
|
|
||
| $cluster2 = Enable-AzAksAddon -Name 'Monitoring' -WorkspaceResourceId $workspaceId -ResourceGroupName $resourceGroupName -ClusterName $kubeClusterName2 | ||
| Assert-AreEqual $true $cluster2.AddonProfiles['omsagent'].Enabled | ||
| Assert-AreEqual 'true' $cluster2.AddonProfiles['omsagent'].Config['useAADAuth'] | ||
| $cluster2 = Disable-AzAksAddon -Name 'Monitoring' -ResourceGroupName $resourceGroupName -ClusterName $kubeClusterName2 | ||
| Assert-AreEqual $false $cluster2.AddonProfiles['omsagent'].Enabled | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,8 @@ | |||||||||
| - Additional information about change #1 | ||||||||||
| --> | ||||||||||
| ## Upcoming Release | ||||||||||
| * Set `useAADAuth` to `true` by default in the omsagent addon profile when enabling the Monitoring addon via `Enable-AzAksAddOn` and `New-AzAksCluster` | ||||||||||
| - This ensures compatibility with the latest Azure Monitor agent which requires AAD authentication | ||||||||||
|
Comment on lines
+21
to
+22
|
||||||||||
| * Set `useAADAuth` to `true` by default in the omsagent addon profile when enabling the Monitoring addon via `Enable-AzAksAddOn` and `New-AzAksCluster` | |
| - This ensures compatibility with the latest Azure Monitor agent which requires AAD authentication | |
| * Updated the Monitoring addon behavior in `Enable-AzAksAddOn` and `New-AzAksCluster` to set `useAADAuth` to `true` by default in the omsagent addon profile | |
| - When you enable the Monitoring addon, Azure Active Directory authentication is now enabled by default for compatibility with the latest Azure Monitor agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
-GenerateSshKeyin this scenario test can make the test flaky and can have side effects on the build agent:New-AzAksCluster -GenerateSshKeywrites to{HOME}/.ssh/id_rsaand throws if that file already exists. Prefer passing-SshKeyValuefrom a test-generated temporary key (or reusing an existing test key) so the test doesn’t depend on or modify the agent’s user profile.