Skip to content

Commit

Permalink
[stress] Add maintenance window and enable node security upgrades (#6917
Browse files Browse the repository at this point in the history
)
  • Loading branch information
benbp authored Sep 12, 2023
1 parent 5238410 commit 88cfc5c
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions tools/stress-cluster/cluster/azure/cluster/cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var agentPools = [
defaultAgentPool
]

resource newCluster 'Microsoft.ContainerService/managedClusters@2022-09-02-preview' = if (!updateNodes) {
resource newCluster 'Microsoft.ContainerService/managedClusters@2023-02-02-preview' = if (!updateNodes) {
name: clusterName
location: location
tags: tags
Expand All @@ -75,6 +75,10 @@ resource newCluster 'Microsoft.ContainerService/managedClusters@2022-09-02-previ
enabled: true
}
}
autoUpgradeProfile: {
nodeOSUpgradeChannel: 'SecurityPatch'
upgradeChannel: null
}
kubernetesVersion: kubernetesVersion
enableRBAC: true
dnsPrefix: dnsPrefix
Expand All @@ -86,7 +90,26 @@ resource newCluster 'Microsoft.ContainerService/managedClusters@2022-09-02-previ
}
}

resource existingCluster 'Microsoft.ContainerService/managedClusters@2022-09-02-preview' existing = if (updateNodes) {
resource maintenanceConfig 'Microsoft.ContainerService/managedClusters/maintenanceConfigurations@2023-05-02-preview' = if (!updateNodes) {
name: 'aksManagedNodeOSUpgradeSchedule'
parent: newCluster
properties: {
maintenanceWindow: {
durationHours: 4
utcOffset: '-08:00'
startTime: '02:00'
schedule: {
weekly: {
dayOfWeek: 'Monday'
intervalWeeks: 1
}
}
}
}
}


resource existingCluster 'Microsoft.ContainerService/managedClusters@2023-02-02-preview' existing = if (updateNodes) {
name: clusterName
}

Expand Down

0 comments on commit 88cfc5c

Please sign in to comment.