From 4e887594382bf4bbe10ae78b225a2074d0c6a167 Mon Sep 17 00:00:00 2001 From: "Vighneshwar (Vigh) Madas" <94487632+iamvighnesh@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:28:11 +0000 Subject: [PATCH] Set default osDiskSizeGB based on OS Type (#661) Co-authored-by: Paul Lewis --- bicep/aksagentpool.bicep | 7 +++++-- bicep/main.bicep | 5 ++++- helper/src/config.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bicep/aksagentpool.bicep b/bicep/aksagentpool.bicep index d31a2b420..493a668a1 100644 --- a/bicep/aksagentpool.bicep +++ b/bicep/aksagentpool.bicep @@ -60,7 +60,10 @@ var spotProperties = { spotMaxPrice: -1 } -resource aks 'Microsoft.ContainerService/managedClusters@2023-08-02-preview' existing = { +// Default OS Disk Size in GB for Linux is 30, for Windows is 100 +var defaultOsDiskSizeGB = osType == 'Linux' ? 30 : 100 + +resource aks 'Microsoft.ContainerService/managedClusters@2023-07-02-preview' existing = { name: AksName } @@ -77,7 +80,7 @@ resource userNodepool 'Microsoft.ContainerService/managedClusters/agentPools@202 availabilityZones: !empty(availabilityZones) ? availabilityZones : null osDiskType: osDiskType osSKU: osSKU - osDiskSizeGB: osDiskSizeGB + osDiskSizeGB: osDiskSizeGB == 0 ? defaultOsDiskSizeGB : osDiskSizeGB osType: osType maxPods: maxPods type: 'VirtualMachineScaleSets' diff --git a/bicep/main.bicep b/bicep/main.bicep index e0f4d1eef..28ec1272d 100644 --- a/bicep/main.bicep +++ b/bicep/main.bicep @@ -1382,6 +1382,9 @@ param osSKU string = 'Ubuntu' var poolName = osType == 'Linux' ? nodePoolName : take(nodePoolName, 6) +// Default OS Disk Size in GB for Linux is 30, for Windows is 100 +var defaultOsDiskSizeGB = osType == 'Linux' ? 30 : 100 + module userNodePool '../bicep/aksagentpool.bicep' = if (!JustUseSystemPool){ name: take('${deployment().name}-userNodePool',64) params: { @@ -1397,7 +1400,7 @@ module userNodePool '../bicep/aksagentpool.bicep' = if (!JustUseSystemPool){ osType: osType osSKU: osSKU enableNodePublicIP: enableNodePublicIP - osDiskSizeGB: osDiskSizeGB + osDiskSizeGB: osDiskSizeGB == 0 ? defaultOsDiskSizeGB : osDiskSizeGB availabilityZones: availabilityZones spotInstance: nodePoolSpot } diff --git a/helper/src/config.json b/helper/src/config.json index 55672feb1..fb712434a 100644 --- a/helper/src/config.json +++ b/helper/src/config.json @@ -50,7 +50,7 @@ "maxCount": 20, "computeType": "gp", "vmSize": "Standard_DS3_v2", - "osDiskSizeGB": 0, + "osDiskSizeGB": 30, "osDiskType": "Ephemeral", "enable_aad": true, "AksDisableLocalAccounts": false,