maksim-paskal / aks-node-termination-handler

Gracefully handle Azure Virtual Machines shutdown within Kubernetes
Apache License 2.0
38 stars 6 forks source link

missing information #54

Closed yazbekhe closed 1 year ago

yazbekhe commented 1 year ago

hello, what are the requirements to use this tool, for example do we need to activate the "Instance termination" in the scaleset of the aks pool? and if yes, how do you recommend to activate it? as with "az aks create" i do not see an option to do it.

maksim-paskal commented 1 year ago

Hi @yazbekhe, thanks for your question, I will try to figure out this parameter, by default this parameter I think is enabled, in my clusters I didn't force enabled this option

maksim-paskal commented 1 year ago

There is no need to enable instance termination notification on scale sets, according to documentation

Scheduled Events is enabled for your scale set the first time you make a request for events. You can expect a delayed response in your first call of up to two minutes. Query the endpoint periodically to detect upcoming maintenance events and the status of ongoing maintenance activities.

When you start this pods in your cluster, pods will make request for events, and this will automatically enable instance termination notification.

For my clusters "Enable instance termination notification" on scale sets is always "Off" but events are received.

yazbekhe commented 1 year ago

thanks, it works

yazbekhe commented 1 year ago

yes you are right events are received but when a VM is being deleted it get deleted automatically which means it does not wait for confirmation before. actually i am trying to use this to manage scale-in and not spot nodes. i am not sure if this will apply

maksim-paskal commented 1 year ago

I think it can be used in such way, by default, this pods run only on spot spot nodes and listens only events for spot instances, you can run this pods on all nodes of your cluster, and I think that this can handle events for all nodes of your cluster.

Please try this instalation:

helm upgrade aks-node-termination-handler \
--install \
--namespace kube-system \
aks-node-termination-handler/aks-node-termination-handler \
--set priorityClassName=system-node-critical \
--set nodeSelector=null

Let me know is it works for you

yazbekhe commented 1 year ago

no it does not work on noraml nodes, because the cluster autoscaler taint the node then delete it, and even if activate manually the instance termination on the scaleset i do not get any event on deletion. thanks for you help