When you use an Azure Resource Manager template to create and managed resources, you can typically update the settings in your template and redeploy to update the resource. With node pools in AKS, the initial node pool profile can't be updated once the AKS cluster has been created. This behavior means that you can't update an existing Resource Manager template, make a change to the node pools, and redeploy. Instead, you must create a separate Resource Manager template that updates only the node pools for an existing AKS cluster.
(https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#manage-node-pools-using-a-resource-manager-template)
Just wanted to clarify. If I create a new AKS cluster with a default/dummy Node Pool can I then use ARM template to delete this Node Pool and replace it with the Node Pool(s) I need? Or do I need to create the first Node Pool with required settings (any of name, node type, node count) and then use ARM template to (only) update existing and or add new node pools?
I have tried creating a new AKS cluster (using ARM templates) but it fails without agentPoolProfiles.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@ondrejhlavacek I think we cant delete the default node pool(Linux) which is created while creating the cluster.
I will check this scenario and update you
@jakaruna-MSFT thanks a lot, let us know!
I have tried using the AKS ARM template to update the default Node Pool node count and it works.
@ondrejhlavacek We can change the node pool node count. Thats equivalent to scaling the nodepool.
We need to check if we can delete or rename the node pool. I think thats not possible
@ondrejhlavacek let me know the api version which you have used with the arm template.
Versions before 2018-03-31(including this) has only managed clusters in api.
Versions after 2018-03-31 has managed clusters and managedclusters/agentpools
So its better to manage nodepools with managedclusters/agentpools.
@jakaruna-MSFT I use 2019-08-01.
So its better to manage nodepools with managedclusters/agentpools.
This is what I understand from the documentation, but it is not possible to create a new AKS cluster without a Node Pool, so managing Node Pools using exclusively managedclusters/agentpools is not possible.
These are my ARM templats - https://gist.github.com/ondrejhlavacek/457e97f4c1c43b389f6ed9ae17f98b19. aks.json has to have a default Node Pool and aks-node-pools.json adds a new syrup node pool.
I'd love to have all Node Pools in a single template, but it's currently only possible in the AKS template, and this pattern is discouraged in the documentation.
I think we need to have one default template with the ARM template while creating a cluster.
Then we can manage the additional nodepools from managedclusters/agentpools
@jluk @sauryadas Please comment on my assumption
Assumption is correct - to create a cluster, it requires defining the first agent pool in the same definition of the cluster. Subsequent updates can be made with agentpools only, but that first pool is required so the system pods can get scheduled altogether.
If you're trying to define in a single template, can you have all your agent pools configured with your managed cluster? We support that, but not separating all agentpools in a deployment away from the control plane deployment.
@jluk Thank you.
@ondrejhlavacek please add your comments
@jakaruna-MSFT @jluk thanks for the replies! I got unexpectedly busy with other stuff at the moment. I expect a week to deal with it to give a sensible comment. Thanks a lot for your patience, will look at it as soon as possible.
@ondrejhlavacek ok.
Try this out.
I will close this out for now. If you need additional help please open a new issue