pulumi-azure icon indicating copy to clipboard operation
pulumi-azure copied to clipboard

AKS cluster with availability zones gets recreated when upgrading to 5.x

Open muellermatthias opened this issue 2 years ago • 0 comments

What happened?

I was trying to upgrade my existing code to version 5.x from 4.x. After following the migration guide by changing a few configurations, pulumi up runs successfully but shows me a replacement of my cluster. The following change is shown:

+-azure:containerservice/kubernetesCluster:KubernetesCluster: (replace)
  [id=/subscriptions/...]
  [urn=urn:...]
  [provider: urn:...]
~ defaultNodePool: {
    + zones: [
    +     [0]: "1"
    +     [1]: "2"
    +     [2]: "3"
      ]
  }

Steps to reproduce

  • Create a cluster that uses availability zones on version 4.x:
new azure.containerservice.KubernetesCluster(name, {
            defaultNodePool: {
                availabilityZones: ["1", "2", "3"],
....
  • Update the provider version to 5.x
  • Update the configuration according to the migration guide:
new azure.containerservice.KubernetesCluster(name, {
            defaultNodePool: {
                zones: ["1", "2", "3"], //One of the changes includes renaming availabilityZones to zones
....
  • Run pulumi up again

Expected Behavior

pulumi up should show no change.

Actual Behavior

Pulumi wants to recreate the cluster (see diff above).

Versions used

No response

Additional context

I tried to fix this by refreshing the state, but that didn't work. I found two workarounds, but I don't like either of them:

  • Add "defaultNodePool.zones" to ignoreChanges
  • Rename availabilityZones to zones in the state file

This issue looks similar to another issue I reported: https://github.com/pulumi/pulumi-azure/issues/1028.

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

muellermatthias avatar May 03 '22 08:05 muellermatthias