Can anyone tell me why Pulumi doesn't simply updat...
# general
p
Can anyone tell me why Pulumi doesn't simply update an existing resource instead of delete-replace? None of the changes in the diff require a delete-replace. Pulumi simply needs to patch the existing resource. It literally defaults to delete-replace my entire production cluster. It's so annoying. It has cost me days of debugging.
Copy code
digitalocean:index/kubernetesCluster:KubernetesCluster: (replace) :lock:
        [id=XXXXXXX]
        [urn=urn:pulumi:prod::infra::digitalocean:index/kubernetesCluster:KubernetesCluster::prod]
        [provider: urn:pulumi:prod::infra::pulumi:providers:digitalocean::default_2_6_0::2a8029dd-96f0-4006-a641-d3c66e947378 => urn:pulumi:prod::infra::pulumi:providers:digitalocean::default_4_0_0::output<string>]
      + autoUpgrade: true
      ~ nodePool   : {
          ~ size: "s-1vcpu-2gb" => "s-2vcpu-4gb"
        }
      ~ version    : "1.18.3-do.0" => "1.18.14-do.0"
b
i'd start by eliminating those changes, are you sure the nodepool instance size changing isn't immutable? is there an upgrade path for the version from 1.18.3 -> 1.18.14? Reduce the amount of changes that are happening
p
I can make both changes through DO's UI. Through the API I can update version https://developers.digitalocean.com/documentation/v2/#upgrade-a-kubernetes-cluster But the node pool requires a delete-replace.
So the node pool size is immutable
It seems that this is a gap in capability for Pulumi DO's package. The planner doesn't know how to upgrade version nor does it treat node pool as its own resource which would be fine to delete-replace as long as replacement is created first, which pulumi would do by default
b
we bridge our pulumi provider from the terraform one, here's the upstream issue tracking it: https://github.com/digitalocean/terraform-provider-digitalocean/issues/182
if you use this resource to build your node pool: https://www.pulumi.com/docs/reference/pkg/digitalocean/kubernetesnodepool/ this won't happen
changing the default node pool on a cluster is immutable, changing an additional one is not
p
That's helpful thank you