Hi. I'm trying to get an environment healthy again...
# azure
w
Hi. I'm trying to get an environment healthy again, and am currently struggling with pulumi thinking there are changes to AKS (e.g. node pool), when no changes have been made. Is there a way to get more detail about what pulumi thinks is changing? Right now all I see is a fairly generic error message (
azure-native:containerservice:AgentPool <agent-pool-name>iled** error: cannot create already existing resource
f
Has an agent pool been created manually by any chance?
As in outside of Pulumi on that AKS
w
thanks for replying. I believe that the pulumi resource name was changed without removing the resource from a deployment. This has caused this (and several other things) to get out of sync, with pulumi believing new resources are being created, and azure throwing errors for already created resources. Right now I am trying to figure out if there is a way to remove an agent pool from an AKS configuration via pulumi, or if I need to do something more drastic (like remove the entire AKS cluster). If you have any insight into that, it would be appreciated
f
You can remove an agent pool and replace it with another
I believe what you would have to do is add a new pool and then in the portal make it your default pool, then remove the old pool and then import the resource back into Pulumi
Copy code
az aks nodepool add \
    --resource-group $RESOURCE_GROUP_NAME \
    --cluster-name $CLUSTER_NAME \
    --name $AZ_LINUX_NODE_POOL_NAME \
    --os-sku AzureLinux
then use this to delete the old pool:
Copy code
az aks nodepool delete --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME --name $NODE_POOL_NAME --no-wait
w
so no way to change or remove an agent pool via a pulumi configuration?
f
Erm well I would do it this way then import it back into Pulumi
Like ive used Terraform for years and similar things for other resources in Azure have happened and Ive always gone about this way to fix it.
w
ok - advice is much appreciated. Thanks
f
No worries. IAC software is always declarative, even though Pulumi is essentially a Programming Language way of doing it. So, if you did this in Pulumi, you would be writing into the code for this to always to happen on each run. You would create a switch of Node pool each time Pulumi runs, which you do not want long-term.