[Feature] Allow enabling Termination Notifications in AKS Node Pools
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 395
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 13
Description
**Is your feature request related to a problem? Please describe.**
Termination notifications are not enabled for VM Scale Sets created from AKS Node Pools.
Also they cannot be enabled, since the parameters in VMSS are not exposed on AKS.
We do not receive an advance warning on when the node is about to be disrupted.
Quote:
> Scheduled Events is an Azure Metadata Service that gives your application time to prepare for virtual machine (VM) maintenance
Screenshot from the Azure Portal will show this for any such node pool (on the Switzerland North region):

**Describe the solution you'd like**
Please expose the VMSS Termination Notifications configuration in AKS Node Pool creation.
New nodes would then have the Scheduled Events enabled.
Currently in the CLI the `az vmss update` accepts the `--enable-terminate-notification` flag.
See: https://learn.microsoft.com/en-us/cli/azure/vmss?view=azure-cli-latest#az-vmss-update-optional-parameters
I ask that the `az aks nodepool add` command could also accept `--enable-terminate-notification` flag and pass it through to VMSS.
Having the flag available in IaC is more important to us, but using CLI since it is easier to explain.
**Describe alternatives you've considered**
Always enable Termination Notifications, similarly to what AWS EC2 implements. This would work for us but maybe not for everyone.
Azure Policy is unable to modify the parameter, see: https://github.com/Azure/azure-policy/issues/1393
Azure documentation suggests to use the `az vmss update` command, see: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-terminate-notification , however this is an additional step and also requires looking up the VMSS resource which AKS created.
**Additional context**
Possibly related:
- https://github.com/Azure/AKS/issues/3528
Contributor guide
Assessment
This issue has not been assessed yet.