3

I want to deploy jupyter notebook on a kubernetes cluster. Following the official documentation(https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub.html), I ran the following command:

# Suggested values: advanced users of Kubernetes and Helm should feel
# free to use different values.
RELEASE=jhub
NAMESPACE=jhub

helm upgrade --install $RELEASE jupyterhub/jupyterhub \
  --namespace $NAMESPACE  \
  --version=0.8.2 \
  --values jupyter-hub-config.yaml

Where jupyter-hub-config.yaml is a config file as mentioned in the doc, containing a token generated by the command openssl rand -hex 32 .

While running the aforementioned command, I get the following error:

Error: release jhub failed: persistentvolumeclaims "hub-db-dir" is forbidden: Internal error occurred: 8 default StorageClasses were found

I tried looking into various methods of installing jhub but none could point me to any difference in this approach that I would consider causing error here.

The o/p of the command kubectl get storageclass is:

NAME                                     PROVISIONER             AGE
aviral-worker-volume (default)           kubernetes.io/aws-ebs   14d
default (default)                        kubernetes.io/aws-ebs   14d
es-ebs-storage (default)                 kubernetes.io/aws-ebs   7d
gp2 (default)                            kubernetes.io/aws-ebs   14d
prometheus-monitoring-volume (default)   kubernetes.io/aws-ebs   8d
replicated (default)                     kubernetes.io/aws-ebs   14d
replicated-premkit (default)             kubernetes.io/aws-ebs   14d
replicated-statsd (default)              kubernetes.io/aws-ebs   14d
Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81

1 Answers1

8

You have 8 default storage classes in your cluster, which is definitely not normal. You should make sure you have only one default storage class.

I don't know which one should be default, it's totally up to your cluster, I don't wanna be responsible for that decision. But for all storage classes except the default you need to do this:

kubectl patch storageclass <your-class-name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
Vasili Angapov
  • 8,061
  • 15
  • 31
  • could you also tell me what is the harm or abnormal in having 8 storage classes? why is that related to the cluster? – Aviral Srivastava May 09 '19 at 12:58
  • 1
    well, itself having 8 or 80 default storage classes is mostly harmless but leads to errors that you face. You may try to specify particular storage class to be consumed by Jupyter Hub but for that you need to download chart, unpack and examine value.yaml file to find what variable is responsible for storage class. And will have to do it every time you install Helm chart which uses volumes. – Vasili Angapov May 09 '19 at 13:03
  • thanks for taking time out and explaining it to me. Could you direct me to resources where I can study `storageclasses` and can deduce such key points, for starters? I did read the kubernetes concept page about `storageclasses` though. – Aviral Srivastava May 09 '19 at 13:57
  • you may read about default storage class here: https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/ – Vasili Angapov May 09 '19 at 13:58