https://pulumi.com logo
#azure
Title
# azure
e

early-sugar-1496

11/22/2020, 2:49 PM
has anyone had any luck with the next gen provider and aks clusters? mostly around adding / removing agent pools and conflicting diffs when trying to replace the pool created with the
ManagedClusterArgs.AgentPoolProfiles
I can create a cluster with a fixed list of
AgentPoolProfiles
no problem. but if I want to add another pool after the cluster has been created, I need to use the
AgentPool
resource and provide it with the cluster name, resource group name, etc.
The tricky part comes when I want to replace one of the original pools with a new one, such as changing the vm size. vm sizes are immutable, but it should still be easy... 1. create new node pool with new vm size 2. delete old node pool except, the old node pool was defined in
ManagedClusterArgs.AgentPoolProfiles
thoughts on how to keep track of which pools were created with the cluster, vs those added later?
t

tall-librarian-49374

11/22/2020, 7:11 PM
I think @sparse-park-68967 might have some context around this
s

sparse-park-68967

11/23/2020, 7:31 PM
You should be able to create a new system nodepool separate from the cluster’s agent profile one. You can name it something that clearly marks it as a new system nodepool. Eventually you should be able to just delete the original nodepool and have everything safely migrate over to the new nodepool. You might have to update the references in the nodepool profile to match the new nodepool in the cluster and do a pulumi refresh. Note I haven’t tried the latter with azure nextgen - this is what I had to do with the old provider. I have been meaning to look into the process for azure-nextgen but haven’t gotten around to it. I will take a look later today and update here. But adding the system nodepool should be entirely safe.
Just circling back here. I did manage to do the above - i.e. create a new system nodepool, delete the old nodepool manually and ensure all pods were relaunched on the new nodepool. Then update the agentpool profile in the cluster to point to the values for the new agentpool and perform a
pulumi refresh
. Going forward the new nodepool will be the system nodepool as desired
e

early-sugar-1496

11/26/2020, 2:23 AM
Thanks for taking the time to look into it. subsequent system pools are working fine, as long as i manually delete the default pool afterwards. is there a way to see if the ComponentResource is being created? that way it can easily know not to create an
AgentPool
for the first system pool without the user of my component having to know the internals (I want them to specify a list of pools, with a requirement that there is a minimum of 1 system pool) i have a similar problem when deleting the cluster after adding a new system pool and deleting the original.
pulumi destroy
fails because it tries to delete the only remaining system pool before deleting the cluster.
3 Views