Is there a way to tell a v4.Chart to retain CRDs o...
# kubernetes
l
Is there a way to tell a v4.Chart to retain CRDs on deletion? Without setting skipCRDs to true
l
How are you defining the CRDs? If you're using a Pulumi resource, using the resource option of retainOnDelete might help
l
The CRDs are inside the Helm chart I'm deploying with v4.Chart. I need it to leave them behind when the chart is deleted, this is normal Helm behavior but doesn't seem to be happening here.
l
I think the best route would be to separate those two and mark the CRD definition as a protected resource. In this way you can run a destroy without deleting the CRDs:
pulumi destroy --exclude-protected
l
Hmm. I don't want to prevent deletion of the Pulumi state, I just want it to retain the CRD like how Helm normally does. Why does Pulumi's Chart resource behave differently here?
b
Because
Chart
bypasses Helm
If you're using
Chart
, it uses
helm template
to synth out all the K8s manifests and then applies them using the 'normal' Pulumi K8s provider resources. So any functionality that is baked into Helm based on context that is held outside of the synthed K8s manifest files won't be usable/used. If you want to use
helm
directly and retain all that helm-specific functionality you need to use
v3.Release
(as
v4.Release
doesn't exist yet)