Skip to content

Commit

Permalink
Set default osDiskSizeGB based on OS Type (#661)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Lewis <[email protected]>
  • Loading branch information
iamvighnesh and pjlewisuk authored Nov 16, 2023
1 parent 76da013 commit 4e88759
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions bicep/aksagentpool.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"maxCount": 20,
"computeType": "gp",
"vmSize": "Standard_DS3_v2",
"osDiskSizeGB": 0,
"osDiskSizeGB": 30,
"osDiskType": "Ephemeral",
"enable_aad": true,
"AksDisableLocalAccounts": false,
Expand Down

0 comments on commit 4e88759

Please sign in to comment.