Hi, has anyone figured out how to delete a statefu...
# kubernetes
Hi, has anyone figured out how to delete a statefulset and it's PVCs with pulumi?
Were the StatefulSet and associated PVCs created using Pulumi?
So what happens when you run
pulumi destroy
it hangs
I guess it might be a specific case because I have a set of hostName (therefore
storageClassName: "manual"
) PersistentVolumes that then get bound by StatefulSet
via PVCs
so pulumi destroy hangs on trying to remove PVs but kubernetes won't remove them until PVCs exist and PVCs are not deleted due to https://github.com/pulumi/pulumi-kubernetes/issues/218
if I run
kubectl delete pvc --all
in second terminal it continues and cleans up everything correctly
Gotcha. Yes, I’d agree with your assessment that this appears to be related to
. I’m not aware of a workaround, but I’ll ask some engineers internally just in case.
there is an obvious workaround related to manual removal of these PVCs so not a complete blocker 😉
not perfect from the perspective of automating such stuff though 😕
Yep, I get it. I’ve asked internally, and I’ll respond here if I get any suggestions. (Or one of our engineers will chime in; a lot of them frequent this Slack community on a regular basis.)
One suggestion to consider: you could use the
provider to automate some of the cleanup process.
for anyone wondering about that - apparently dropping the whole namespace also works so separating the workload into it's own namespace is one way out too
Good to know, thanks!