<p>I am hosting a jupyterhub with kubernetes on my google cloud account. I noticed that google cloud charges me for the runtime that the jupyterhub instance is running. <br/>
I am wondering if I can sorta shut down the jupyterhub instance or the kubernetes when we are not using the jupyterhub to save money? <br/>
If I restart the instance, will the data be whiped out? I want to do a experiment on this but I am afraid of doing something inreversible.<br/>
Also, where can I learn more about the adminstration tips about using google cloud?
Thanks!</p>

<p>You can resize your GKE cluster to "0", when you don't need it, with the below command </p>

<pre><code>cloud container clusters resize CLUSTERNAME --size=0
</code></pre>

<p>Then you won't be charged, GKE charges only for worker nodes and not for master nodes.</p>

<p>And if you want to make sure your data is persistent after each time you are scaling your cluster, then you will need to use <a href="https://kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk" rel="nofollow noreferrer">gcePersistentDisk</a>.
You can create PD using gcloud before mounting it to your deployment.</p>

<pre><code>gcloud compute disks create --size=500GB --zone=us-central1-a my-data-disk
</code></pre>

<p>Then you can configure your Pod configuration like in example <a href="https://kubernetes.io/docs/concepts/storage/volumes/#example-pod-1" rel="nofollow noreferrer">here</a></p>

<p>Just make sure to mount all necessary paths of containers on Persistent Disk.</p>

<p>For more information for Kubernetes Engine pricing <a href="https://cloud.google.com/kubernetes-engine/pricing" rel="nofollow noreferrer">check</a></p>
