Skip to content

Commit

Permalink
Set default osDiskSizeGB based on OS Type
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvighnesh committed Oct 13, 2023
1 parent fc29417 commit 0d50a50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bicep/aksagentpool.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ param autoTaintWindows bool = false

var taints = autoTaintWindows ? union(nodeTaints, ['sku=Windows:NoSchedule']) : nodeTaints

// 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@2021-10-01' existing = {
name: AksName
}
Expand All @@ -68,7 +71,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 @@ -1375,6 +1375,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 @@ -1390,7 +1393,7 @@ module userNodePool '../bicep/aksagentpool.bicep' = if (!JustUseSystemPool){
osType: osType
osSKU: osSKU
enableNodePublicIP: enableNodePublicIP
osDiskSizeGB: osDiskSizeGB
osDiskSizeGB: osDiskSizeGB == 0 ? defaultOsDiskSizeGB : osDiskSizeGB
availabilityZones: availabilityZones
}
}
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 0d50a50

Please sign in to comment.