|
| 1 | +--- |
| 2 | +title: Use Planned Maintenance for your Azure Kubernetes Service (AKS) cluster weekly releases (preview) |
| 3 | +titleSuffix: Azure Kubernetes Service |
| 4 | +description: Learn how to use Planned Maintenance in Azure Kubernetes Service (AKS) for cluster weekly releases |
| 5 | +services: container-service |
| 6 | +ms.topic: article |
| 7 | +ms.date: 09/16/2021 |
| 8 | +ms.author: kaarthis |
| 9 | +author: kaarthis |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +# Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster exclusively for weekly releases (preview) |
| 14 | + |
| 15 | + Planned Maintenance allows you to schedule weekly maintenance windows that will ensure the weekly releases [releases] are controlled. Maintenance Windows are configured using the Azure CLI, allowing you to select from a set of pre-available configurations. |
| 16 | + |
| 17 | +## Before you begin |
| 18 | + |
| 19 | +This article assumes that you have an existing AKS cluster. If you need an AKS cluster, see the AKS quickstart [using the Azure CLI][aks-quickstart-cli], [using Azure PowerShell][aks-quickstart-powershell], or [using the Azure portal][aks-quickstart-portal]. |
| 20 | + |
| 21 | +[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)] |
| 22 | + |
| 23 | +### Limitations |
| 24 | + |
| 25 | +When using Planned Maintenance, the following restrictions apply: |
| 26 | + |
| 27 | +- AKS reserves the right to break these windows for unplanned/reactive maintenance operations that are urgent or critical. |
| 28 | +- Currently, performing maintenance operations are considered *best-effort only* and are not guaranteed to occur within a specified window. |
| 29 | +- Updates cannot be blocked for more than seven days. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +## Available pre-created public maintenance configurations for you to pick |
| 34 | + |
| 35 | +There are 2 general kinds of pre-created public maintenance configurations: |
| 36 | + |
| 37 | +- For Weekday (Monday, Tuesday, Wednesday, Thursday), from 10 pm to 6 am next morning. |
| 38 | +- For Weekend (Friday, Saturday, Sunday), from 10 pm to 6 am next morning. |
| 39 | + |
| 40 | +For a list of pre-created public maintenance configurations on the weekday schedule, see below. For weekend schedules, replace `weekday` with `weekend`. |
| 41 | + |
| 42 | +|Configuration name| Time zone| |
| 43 | +|--|--| |
| 44 | +|aks-mrp-cfg-weekday_utc12|UTC+12| |
| 45 | +|...|...| |
| 46 | +|aks-mrp-cfg-weekday_utc1|UTC+1| |
| 47 | +|aks-mrp-cfg-weekday_utc|UTC+0| |
| 48 | +|aks-mrp-cfg-weekday_utc-1|UTC-1| |
| 49 | +|...|...| |
| 50 | +|aks-mrp-cfg-weekday_utc-12|UTC-12| |
| 51 | + |
| 52 | +## Assign a public maintenance configuration to an AKS Cluster |
| 53 | + |
| 54 | +Find the public maintenance configuration ID by name: |
| 55 | +```azurecli-interactive |
| 56 | +az maintenance public-configuration show --resource-name "aks-mrp-cfg-weekday_utc8" |
| 57 | +``` |
| 58 | +This call may prompt you to install the `maintenance` extension. Once done, you can proceed: |
| 59 | + |
| 60 | +The output should look like the below example. Be sure to take note of the `id` field - |
| 61 | +```json |
| 62 | +{ |
| 63 | +"duration": "08:00", |
| 64 | +"expirationDateTime": null, |
| 65 | +"extensionProperties": { |
| 66 | +"maintenanceSubScope": "AKS" |
| 67 | +}, |
| 68 | +"id": "/subscriptions/0159df5c-b605-45a9-9876-36e17d5286e0/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/aks-mrp-cfg-weekday_utc8", |
| 69 | +"installPatches": null, |
| 70 | +"location": "westus2", |
| 71 | +"maintenanceScope": "Resource", |
| 72 | +"name": "aks-mrp-cfg-weekday_utc8", |
| 73 | +"namespace": "Microsoft.Maintenance", |
| 74 | +"recurEvery": "Week Monday,Tuesday,Wednesday,Thursday", |
| 75 | +"startDateTime": "2022-08-01 22:00", |
| 76 | +"systemData": null, |
| 77 | +"tags": {}, |
| 78 | +"timeZone": "China Standard Time", |
| 79 | +"type": "Microsoft.Maintenance/publicMaintenanceConfigurations", |
| 80 | +"visibility": "Public" |
| 81 | +} |
| 82 | +``` |
| 83 | + |
| 84 | +Next, assign the public maintenance configuration to your AKS cluster using the ID: |
| 85 | +```azurecli-interactive |
| 86 | +az maintenance assignment create --maintenance-configuration-id "/subscriptions/0159df5c-b605-45a9-9876-36e17d5286e0/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/aks-mrp-cfg-weekday_utc8" --name assignmentName --provider-name "Microsoft.ContainerService" --resource-group myResourceGroup --resource-name myAKSCluster --resource-type "managedClusters" |
| 87 | +``` |
| 88 | +## List all maintenance windows in an existing cluster |
| 89 | +```azurecli-interactive |
| 90 | +az maintenance assignment list --provider-name "Microsoft.ContainerService" --resource-group myResourceGroup --resource-name myAKSCluster --resource-type "managedClusters" |
| 91 | +``` |
| 92 | + |
| 93 | +## Delete a public maintenance configuration of an AKS cluster |
| 94 | +```azurecli-interactive |
| 95 | +az maintenance assignment delete --name assignmentName --provider-name "Microsoft.ContainerService" --resource-group myResourceGroup --resource-name myAKSCluster --resource-type "managedClusters" |
| 96 | +``` |
| 97 | + |
| 98 | +<!-- LINKS - Internal --> |
| 99 | +[aks-quickstart-cli]: ./learn/quick-kubernetes-deploy-cli.md |
| 100 | +[aks-quickstart-portal]: ./learn/quick-kubernetes-deploy-portal.md |
| 101 | +[aks-quickstart-powershell]: ./learn/quick-kubernetes-deploy-powershell.md |
| 102 | +[aks-support-policies]: support-policies.md |
| 103 | +[aks-faq]: faq.md |
| 104 | +[az-extension-add]: /cli/azure/extension#az_extension_add |
| 105 | +[az-extension-update]: /cli/azure/extension#az_extension_update |
| 106 | +[az-feature-list]: /cli/azure/feature#az_feature_list |
| 107 | +[az-feature-register]: /cli/azure/feature#az_feature_register |
| 108 | +[az-aks-install-cli]: /cli/azure/aks#az_aks_install_cli |
| 109 | +[az-provider-register]: /cli/azure/provider#az_provider_register |
| 110 | +[aks-upgrade]: upgrade-cluster.md |
| 111 | +[releases]:release-tracker.md |
0 commit comments