Skip to content
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

Set default osDiskSizeGB based on OS Type #661

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading