Hi, has anyone figured out how to delete a statefu...
# kubernetes
q
Hi, has anyone figured out how to delete a statefulset and it's PVCs with pulumi?
s
Were the StatefulSet and associated PVCs created using Pulumi?
q
yep
s
So what happens when you run
pulumi destroy
?
q
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
s
Gotcha. Yes, I’d agree with your assessment that this appears to be related to
pulumi-kubernetes#218
. I’m not aware of a workaround, but I’ll ask some engineers internally just in case.
q
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 😕
s
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
pulumi-command
provider to automate some of the cleanup process.
q
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
s
Good to know, thanks!