From 319559d1da9c77ce63b0821754e30494633283d9 Mon Sep 17 00:00:00 2001 From: Billy Bunter Date: Thu, 1 Feb 2024 17:13:31 +0000 Subject: [PATCH] Added UI & BiCep update for issue 551. --- bicep/main.bicep | 16 +++++++++++++- helper/src/components/addonsTab.js | 34 +++++++++++++++++++++++++++++- helper/src/components/deployTab.js | 1 + helper/src/config.json | 5 ++++- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/bicep/main.bicep b/bicep/main.bicep index dfb223fc0..96f0ce013 100644 --- a/bicep/main.bicep +++ b/bicep/main.bicep @@ -1166,6 +1166,15 @@ var systemPoolPresets = { } } +@description('Enables the use of a customer user-assigned managed identity for the control plane') +param useuserassignedidentityforkublet bool = false + +@description('Enables the use of a customer user-assigned managed identity for the control plane') +param KubeletCustomUserIdentity string = '' + +@description('Enables the use of a customer user-assigned managed identity for the control plane') +param KubeletCustomUserIdentityResourceGroup string = '' + var systemPoolBase = { name: JustUseSystemPool ? nodePoolName : 'npsystem' vmSize: agentVMSize @@ -1336,6 +1345,11 @@ var aksProperties = union({ nodeResourceGroupProfile: { restrictionLevel: restrictionLevelNodeResourceGroup } + identityProfile: (useuserassignedidentityforkublet == 'no') ? null : { + kubeletidentity: { + resourceId : resourceId('${KubeletCustomUserIdentityResourceGroup}','Microsoft.ManagedIdentity/userAssignedIdentities', '${KubeletCustomUserIdentity}') + } + } }, outboundTrafficType == 'managedNATGateway' ? managedNATGatewayProfile : {}, defenderForContainers && createLaw ? azureDefenderSecurityProfile : {}, @@ -1360,7 +1374,7 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-07-02-preview' = { } } : { type: 'SystemAssigned' - } + } sku: { name: 'Base' tier: akssku diff --git a/helper/src/components/addonsTab.js b/helper/src/components/addonsTab.js index 937d79785..33f618ce6 100644 --- a/helper/src/components/addonsTab.js +++ b/helper/src/components/addonsTab.js @@ -534,7 +534,7 @@ export default function ({ tabValues, updateFn, featureFlag, invalidArray,showPr @@ -544,6 +544,38 @@ export default function ({ tabValues, updateFn, featureFlag, invalidArray,showPr + + + + This option is only applicable providing a custom user managed account is also used for the control plane. + Without it, you will see an error similar to "Custom Kubelet Identity Only Supported On User Assigned MSI Cluster". + Select the "Security Principals --> Cluster with additional security controls" option above and this will be enabled automatically. + + + updateFn("useuserassignedidentityforkubelet", key)} + /> + + {addons.useuserassignedidentityforkubelet !== 'no' && + <> + {updateFn("kubeletCustomUserIdentity", v)}} value={addons.kubeletCustomUserIdentity} /> + {updateFn("kubeletCustomUserIdentityResourceGroup", v)}} value={addons.kubeletCustomUserIdentityResourceGroup} /> + + } + + + + +