Hi @Yaron Bar
Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
Kindly note AKS manages the lifecycle and operations of agent nodes on your behalf and modifying the IaaS resources associated with the agent nodes is not supported.
An example of an unsupported operation is customizing a node pool virtual machine scale set by manually changing configurations in the Azure portal or from the API.
However, when you create an AKS cluster or add a node pool to your cluster, you can customize a subset of commonly used OS and kubelet settings which are listed on the below page
https://learn.microsoft.com/en-us/azure/aks/custom-node-configuration?tabs=linux-node-pools
While cloud-init is commonly used on Linux VMs, it is not directly supported for AKS node pools. Instead, you should use Kubernetes-native mechanisms like Daemon Sets to achieve similar functionality. The requirement is listed on below page
https://learn.microsoft.com/en-us/azure/aks/support-policies#user-customization-of-agent-nodes
Refer the daemon set definition on below page -
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
Kindly note Azure support cannot help troubleshooting or diagnose modifications that makes the node unavailable due to a custom deployed daemon set.
If the below answer addressed your query, please don’t forget to click "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
Thanks,