Thread
#azure
    c

    clever-byte-21551

    7 months ago
    I was trying to migrate from 1.11.0 to 1.59.0 in azure native and I noticed that since this upgrade my AKS cluster is being recreated over and over again it says there’s a change in agentPoolProfiles, the way we create our AKS clusters is configuring a single agentPoolProfile on the 
    ManagedCluster
     and we create a coupe of additional agent pools using the 
    NewAgentPool
     api. I suspect that this causes us to recreate the cluster, when I downgraded the provider plugin it was back to normal We keep seeing this diff in the logs:
    aks updated [diff: ~agentPoolProfiles]
    I don’t want to add to ignoreChanges the agentPoolProfiles because this will hinder our ability to mutate the stack
    Further investigating this - After upgrading we are forced to recreate the cluster like a said. Subsequent stack updates won’t trigger recreation however - let’s say I just modified node count for the system agent pool -> it forces an entire cluster recreation while it never should! Something is obviously broken and we’re unable to upgrade to newer versions because of this. I thought about trying various versions but these tests take forever as recreation takes ~15-20 minutes each time..
    Using our existing stack definition, running update stack from scratch in version 1.59.0 works, cluster is created successfully However subsequent call to stack update triggers an entire cluster recreation..! There’s definitely some regression, how can I check which field triggered the recreation? I’m only seeing this:
    aks updated [diff: ~agentPoolProfiles]
    Another issue that happens occacionally during these cluster recreations
    azure-native:containerservice/v20210501:ManagedCluster (aks):
        error: 1 error occurred:
            * Code="ReconcileMSICredentialError" Message="Reconcile MSI credential failed. Details: autorest/azure: Service returned an error. Status=404 Code=\"NotFound\" Message=\"Resource '/subscriptions/XXXX/resourcegroups/dev-eu1-eastus2-xxx-orchestrator-rg-kMr7/providers/Microsoft.ContainerService/managedClusters/xxx-orchestrator-aks-v2p-eastus2-kmr7' was not found.\"."
    https://github.com/pulumi/pulumi-azure-native/issues/1532 Created a ticket with all the information
    @happy-parrot-60128