Zero-to-jupyterhub-k8s: Preserving user space storage on deployment deletion

Created on 18 Apr 2018  路  4Comments  路  Source: jupyterhub/zero-to-jupyterhub-k8s

We are using GCE to run our k8s deployment. If I wanted to delete a deployment and launch a new one with the same users, is there a way to preserve user space storage and transfer it to the new deployment?

documentation question

All 4 comments

@jgerardsimcock I think you can't have it deleted by deleting your helm releases. So I'm quite confident, but not confident enough to be held responsible, that if you don't manually delete the users' storage specifically, it will remain during a reset of the deployed Helm chart.

@jgerardsimcock I read up on this and now I'm more confident on the situation.

If you write kubectl get pvc you will see the requested storage by kubespawner. They in turn have caused google cloud to provision storage to you, based on the default storage class. To see the provisioned storage, run kubectl get pv and to see the storage class run kubect get storageclass. Note that you can use the --output yaml flag to get more information about the objects you get.

To summarize what I learned

  • The PVC are dynamically created by kubespawner, and is not under Helms control.
  • These PVC in turn get a PV provisioned by google, and will be of the default storage class type, and will also use the default reclaim policy defined in the storage class which is delete. This means, that if you delete the PVC, the PV will be deleted. I just tried this, and the PV was deleted in less than ten seconds.

My conclusion

Make sure to avoid manually deleting the PVCs. Don't touch the PVs.

Thanks for raising the question! Do you feel your question was answered?

I can confirm that after deleting my deployment, and redeploying, my pv's are still there.

Was this page helpful?
0 / 5 - 0 ratings