I am running JupyterHub on Microk8s. I hope to keep the JupyterHub configuration (it is better to have all user’s accounts) and to recover back JupyterHub’s original setting when JupyterHub crashes. Is it possible? How to implement?
If you’re using the default Z2JH configuration then when JupyterHub crashes it should automatically reload it’s database from a persistent volume.
If what you actually want is the ability to rebuild your Microk8s cluster from scratch, then you’ll need to backup your Z2JH configuration file(s), and any Kubernetes persistent volumes/claims. You’ll then need to restore those persistent volumes/claims, but this depends on what storage provider you’ve configured Microk8s with.
Thanks Simon. Sorry, I am new to microk8s and Z2JH.
I install microk8s with hostpath-storage enabled, and use the default Z2JH to install, then setup with https, nativeauthenticator and datascience-notebook. If I want to rebuild microk8s cluster from scratch, is it correct to do:
- I need to find out the source path from the pv and backup the data from the source path.
- reinstall Z2JH and copy back the data to the source path.
Is it correct?
My other questions are:
How to backup my Z2JH configuration file? Is it possible to backup Z2JH users’ account? What kind of information to store in database?
I don’t use Microk8s, but they have a tutorial on how to backup your cluster:
https://microk8s.io/docs/velero
Your Z2JH config file is just a file, so you can keep a copy of it anywhere, e.g. on GitHub, or a shared drive. Information on your users will be in the JupyterHub database on a persistent volume, so can be backed-up and restored in the same way as your user’s storage volumes.