Maintenance Windows¶
Maintenance windows tell AKS when cluster auto-upgrades, node OS updates, and AKS-managed releases are allowed to run. They do not constrain manual az aks upgrade operations, which run when you invoke them. They reduce surprise, but they do not replace upgrade planning or workload validation.
Prerequisites¶
- Business change windows and blackout periods are known.
- Cluster auto-upgrade and node OS channel decisions are already made.
- Production workloads can tolerate node drains inside the selected window length.
When to Use¶
- Aligning cluster lifecycle work to approved change windows.
- Separating Kubernetes minor-version movement from node OS image movement.
- Blocking maintenance during holidays, freezes, or high-risk business periods.
Procedure¶
flowchart TD
A[Pick maintenance intent] --> B{AKS releases only?}
B -->|Yes| C[default]
B -->|No| D{Cluster auto-upgrade timing?}
D -->|Yes| E[aksManagedAutoUpgradeSchedule]
D -->|No| F[aksManagedNodeOSUpgradeSchedule] Configuration types¶
| Configuration | Controls | Use when |
|---|---|---|
default | AKS weekly releases for control-plane components and system add-ons. | You want a window for AKS-initiated platform maintenance. |
aksManagedAutoUpgradeSchedule | Cluster auto-upgrade timing. | You want Kubernetes version automation to happen in a specific window. |
aksManagedNodeOSUpgradeSchedule | Node OS security or node image rollout timing. | You want node OS maintenance to happen independently from cluster-version automation. |
All three configurations can coexist.
Maintenance window design rules¶
- Use four hours or more for auto-upgrade and node OS maintenance.
- Stagger windows across clusters instead of lining up every cluster in a subscription at the same time.
- Use
notAllowedDatesto block maintenance during change freezes and business-critical dates. - Treat windows as best-effort scheduling, not a guarantee that AKS will never need urgent reactive maintenance outside them.
Add the configurations¶
az aks maintenanceconfiguration add \
--resource-group "$RG" \
--cluster-name "$CLUSTER_NAME" \
--name default \
--schedule-type Weekly \
--day-of-week Sunday \
--interval-weeks 1 \
--duration 4 \
--utc-offset +00:00 \
--start-time 01:00
az aks maintenanceconfiguration add \
--resource-group "$RG" \
--cluster-name "$CLUSTER_NAME" \
--name aksManagedAutoUpgradeSchedule \
--schedule-type Weekly \
--day-of-week Sunday \
--interval-weeks 1 \
--duration 4 \
--utc-offset +00:00 \
--start-time 02:00
| Command | Purpose |
|---|---|
az aks maintenanceconfiguration add | Add the weekly maintenance schedules for the cluster. |
--resource-group | Resource group that contains the AKS cluster. |
--cluster-name | Name of the AKS cluster. |
--name | Name of the maintenance configuration. |
--schedule-type | Recurrence type for the schedule. |
--day-of-week | Day of week the maintenance window opens. |
--interval-weeks | Number of weeks between windows. |
--duration | Length of the maintenance window in hours. |
--utc-offset | UTC offset applied to the start time. |
--start-time | Local start time of the window. |
Use a JSON configuration file when you need notAllowedDates:
{
"properties": {
"maintenanceWindow": {
"schedule": {
"weekly": {
"intervalWeeks": 1,
"dayOfWeek": "Sunday"
}
},
"durationHours": 4,
"utcOffset": "+00:00",
"startTime": "02:00",
"notAllowedDates": [
{
"start": "2026-12-20",
"end": "2027-01-03"
}
]
}
}
}
Inspect the effective configuration¶
az aks maintenanceconfiguration list \
--resource-group "$RG" \
--cluster-name "$CLUSTER_NAME"
az aks maintenanceconfiguration show \
--resource-group "$RG" \
--cluster-name "$CLUSTER_NAME" \
--name aksManagedNodeOSUpgradeSchedule
| Command | Purpose |
|---|---|
az aks maintenanceconfiguration list | List the maintenance configurations on the cluster. |
--resource-group | Resource group that contains the AKS cluster. |
--cluster-name | Name of the AKS cluster. |
az aks maintenanceconfiguration show | Show a single maintenance configuration. |
--resource-group | Resource group that contains the AKS cluster. |
--cluster-name | Name of the AKS cluster. |
--name | Name of the maintenance configuration to show. |
Verification¶
- All intended maintenance configurations exist.
- Cluster auto-upgrade and node OS channels each map to their own schedule where needed.
- Blackout periods are represented in
notAllowedDatesfor sensitive periods.
Rollback / Troubleshooting¶
- If maintenance lands at the wrong time, verify that you edited the correct configuration type rather than only the
defaultschedule. - If upgrades do not occur, confirm the cluster was running during the window and that the window was long enough.
- If production risk remains high even with maintenance windows, use Blue-Green Upgrades for the workload move instead of relying on window timing alone.