.. _howto/delete-hub: ================ Delete or spin down a Hub ================ Why delete or spin down a hub? ===================== Sometimes we want to spin down or delete a hub: #. A course or department won't be needing their hub for a while #. The hub will be re-deployed in to a new or shared node pool. Steps to spin down a hub: ------------ If the hub is using a shared filestore, skip all filestore steps. If the hub is using a shared node pool, skip all namespace and node pool steps. #. Scale the node pool to zero: ``kubectl -n scale --replicas=0 deployment/hub`` #. Kill any remaining users' servers. Find any running servers with ``kubectl -n get pods | grep jupyter`` and then ``kubectl -n delete pod `` to stop them. #. Create filestore backup: ``gcloud filestore backups create -backup-YYYY-MM-DD --file-share=shares --instance= --region "us-central1" --labels=filestore-backup=,hub=`` #. Log in to ``nfsserver-01`` and unmount filestore from nfsserver: ``sudo umount /export/-filestore`` #. Comment out the hub build steps out in ``.circleci/config.yaml`` (deploy and build steps) #. Comment out GitHub label action for this hub in ``.github/labeler.yml`` #. Comment hub entries out of ``datahub/node-placeholder/values.yaml`` #. Delete k8s namespace: ``kubectl delete namespace -staging -prod`` #. Delete k8s node pool: ``gcloud container node-pools delete --project "ucb-datahub-2018" --cluster "fall-2019" --region "us-central1"`` #. Delete filestore: ``gcloud filestore instances delete -filestore --zone "us-central1-b"`` #. Delete PV: ``kubectl get pv --all-namespaces|grep `` to get the PV names, and then ``kubectl delete pv `` #. All done.