title: JupyterHub Hub Pod stuck in pending - pod has unbound immediate PersistentVolumeClaims
body: <p>I am having issues deploying juypterhub on kubernetes cluster. The issue I am getting is that the hub pod is stuck in pending. </p>
  
  <p>Stack:
  kubeadm
  flannel
  weave
  helm
  jupyterhub</p>
  
  <p>Runbook:</p>
  
  <pre><code>$kubeadm init --pod-network-cidr="10.244.0.0/16" 
  $sudo cp /etc/kubernetes/admin.conf $HOME/ &amp;&amp; sudo chown $(id -u):$(id -g) $HOME/admin.conf &amp;&amp; export KUBECONFIG=$HOME/admin.conf
  $kubectl create -f pvc.yml
  $kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-aliyun.yml
  $kubectl apply --filename https://git.io/weave-kube-1.6
  $kubectl taint nodes --all node-role.kubernetes.io/master-
  </code></pre>
  
  <p>Helm installations as per <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-helm.html" rel="nofollow noreferrer">https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-helm.html</a></p>
  
  <p>Jupyter installations as per <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub.html" rel="nofollow noreferrer">https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub.html</a></p>
  
  <p><strong>config.yml</strong></p>
  
  <pre><code>proxy:
    secretToken: "asdf"
  singleuser:
    storage:
      dynamic:
        storageClass: local-storage
  </code></pre>
  
  <p><strong>pvc.yml</strong></p>
  
  <pre><code>apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: standard
  spec:
    capacity:
      storage: 100Gi
    # volumeMode field requires BlockVolume Alpha feature gate to be enabled.
    volumeMode: Filesystem
    accessModes:
    - ReadWriteOnce
    persistentVolumeReclaimPolicy: Delete
    storageClassName: local-storage
    local:
      path: /dev/vdb
    nodeAffinity:
      required:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - example-node
  ---
  kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: standard
  spec:
    storageClassName: local-storage
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 3Gi
  ---
  kind: StorageClass
  apiVersion: storage.k8s.io/v1
  metadata:
    name: local-storage
  provisioner: kubernetes.io/no-provisioner
  volumeBindingMode: WaitForFirstConsumer
  </code></pre>
  
  <p>The warning is:</p>
  
  <pre><code>$kubectl --namespace=jhub get pod
  
  NAME                     READY   STATUS    RESTARTS   AGE
  hub-fb48dfc4f-mqf4c      0/1     Pending   0          3m33s
  proxy-86977cf9f7-fqf8d   1/1     Running   0          3m33s
  
  $kubectl --namespace=jhub describe pod hub
  
  Events:
    Type     Reason            Age                From               Message
    ----     ------            ----               ----               -------
    Warning  FailedScheduling  35s (x3 over 35s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims
  
  
  
  $kubectl --namespace=jhub describe pv
  
  Name:            standard
  Labels:          type=local
  Annotations:     pv.kubernetes.io/bound-by-controller: yes
  Finalizers:      [kubernetes.io/pv-protection]
  StorageClass:    manual
  Status:          Bound
  Claim:           default/standard
  Reclaim Policy:  Retain
  Access Modes:    RWO
  VolumeMode:      Filesystem
  Capacity:        10Gi
  Node Affinity:   &lt;none&gt;
  Message:
  Source:
      Type:          HostPath (bare host directory volume)
      Path:          /dev/vdb
      HostPathType:
  Events:            &lt;none&gt;
  
  
  $kubectl --namespace=kube-system describe pvc
  
  Name:          hub-db-dir
  Namespace:     jhub
  StorageClass:
  Status:        Pending
  Volume:
  Labels:        app=jupyterhub
                 chart=jupyterhub-0.8.0-beta.1
                 component=hub
                 heritage=Tiller
                 release=jhub
  Annotations:   &lt;none&gt;
  Finalizers:    [kubernetes.io/pvc-protection]
  Capacity:
  Access Modes:
  VolumeMode:    Filesystem
  Events:
    Type       Reason         Age                From                         Message
    ----       ------         ----               ----                         -------
    Normal     FailedBinding  13s (x7 over 85s)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
  Mounted By:  hub-fb48dfc4f-mqf4c
  </code></pre>
  
  <p>I tried my best to follow the localstorage volume configuration on the official kubernetes website, but with no luck</p>
  
  <p>-G</p>