Hi all. I'm installing a helm chart with Pulumi (T...
# general
w
Hi all. I'm installing a helm chart with Pulumi (Typescript if it matters). Today I discovered that one of the third-party charts I'm installing relies pretty heavily on the
.Release.IsInstall
built-in object for helm. I'm currently using k8s.helm.v3.Chart for the deployment. It seems that it always sets
.Release.IsInstall
to
true
and
.Release.IsUpgrade
to
false
. k8s.helm.v3.Release does set these values right. I'm in a bind. Either I need to get it working for k8s.helm.v3.Chart or switch to k8s.helm.v3.Release. For the former, I'm coming up empty. For the later, there isn't any docs on that. Just swapping the Chart to Release doesn't work gracefully because pulumi will try to delete resources at the same time helm will try to create resources with the same name. Any tips?
v
Hi John. I’ve always used release, as you say pulumi will try to delete the resources before provisioning the new ones (or simultaneously). If you can’t afford to have any down time whilst provisioning, I’d probably recommend provisioning a stack side by side and destroying the old one. Is that a possibility?
w
I'm willing to have downtime 🤔 The issue, when I've played around, is that it will delete the chart and install the helm resource simultaneously. Say I have StatefulSet
x
in the chart
simple
. The
pulumi apply
will spit out
resource simple/x was not successfully created by the Kubernetes API server : statefulsets.apps "x" already exists
. I need the delete to happen first. This is not implemented. I'm iffy about running
pulumi destroy --target
. That would solve the simultaneity problem. (I'm lucky that the resource isn't in a
dependsOn
block of another resource. I had a different issue once like this and when the resource is in a dependsOn block of another component, selectively deleting it is difficult).
v
I’d try destroying the stack as it is then running a fresh up
c
Yeah you need to do a two phase release, pulumi has no way to do "delete before upsert" dependencies between resources.
w
I was playing with the code. It is pretty easy to add a manual
isUpgrade
flag to the code. (I have that coded up.) Don't see a way to find out whether something actually is an upgrade (if the k8s.helm.v3.Chart resource is new or being updated). Any clues?
I have a way to manually set the flag on a branch https://github.com/pulumi/pulumi-kubernetes/compare/master...jdmaguire:pulumi-kubernetes:add-is-upgrade-override?expand=1, something like that would fix my issue. The 'best' fix would be to be able to infer that flag in the code 😞 but I'm not sure when/where I could get the information to tell whether the v3::Chart pulumi resource is being created or updated. That will be digging for another day.