title: Kubernetes : node(s) didn't find available persistent volumes to bind
body: <p>I am trying to set up a local storage as outlined here (<a href="https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/" rel="nofollow noreferrer">https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/</a>) . I'm getting the following error that the scheduler is unable to schedule the pods . The local storage is mapped to one of the worker node. I tried setting up the local storage on master node and I got the same error. WHere am I going wrong?</p>
  
  <p>Warning  FailedScheduling  24s (x2 over 24s)  default-scheduler  0/3 nodes are available: 1 node(s) didn't match node selector, 2 node(s) didn't find available persistent volumes to bind.</p>
  
  <pre><code>-------------------------------------------------------------------
  
  kubectl get nodes -o wide
  NAME                  STATUS   ROLES    AGE   VERSION   INTERNAL-IP      EXTERNAL-IP   OS-IMAGE                         KERNEL-VERSION      CONTAINER-RUNTIME
  rpi-k8-workernode-2   Ready    &lt;none&gt;   92d   v1.15.0   192.168.100.50   &lt;none&gt;        Raspbian GNU/Linux 9 (stretch)   4.19.42-v7+         docker://18.9.0
  rpi-mon-k8-worker     Ready    &lt;none&gt;   91d   v1.15.0   192.168.100.22   &lt;none&gt;        Raspbian GNU/Linux 9 (stretch)   4.19.42-v7+         docker://18.9.0
  udubuntu              Ready    master   92d   v1.15.1   192.168.100.24   &lt;none&gt;        Ubuntu 18.04.3 LTS               4.15.0-55-generic   docker://19.3.4
  
  -------------------------------------------------------------------
  kind: StorageClass
  apiVersion: storage.k8s.io/v1
  metadata:
    name: local-storage
  provisioner: kubernetes.io/no-provisioner
  volumeBindingMode: WaitForFirstConsumer
  ------------------------------------------------------------------------
  
  apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: pv-ghost
    namespace: ghost
  spec:
    capacity:
      storage: 10Gi
    accessModes:
    - ReadWriteOnce
    persistentVolumeReclaimPolicy: Retain
    storageClassName: local-storage
    local:
      path: /mnt/mydrive/ghost-data/
    nodeAffinity:
      required:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - rpi-mon-k8-worker
  ------------------------------------------------------------------------
  apiVersion: v1
  
  kind: PersistentVolumeClaim
  
  metadata:
    name: pvc-ghost
    namespace: ghost
    labels:
      pv: pv-ghost
  
  spec:
    accessModes:
      - ReadWriteOnce
  
    resources:
      requests:
        storage: 10Gi
    storageClassName: local-storage
    selector:
      matchLabels:
        name: pv-ghost
  ------------------------------------------------------------------------
  
  apiVersion: apps/v1
  
  kind: Deployment
  metadata:
    name:
      deployment-ghost
    namespace: ghost
    labels:
      env: prod
      app: ghost-app
  
  spec:
    template:
      metadata:
        name: ghost-app-pod
        labels:
          app:  ghost-app
          env:  production
      spec:
        containers:
          - name: ghost
            image: arm32v7/ghost
            imagePullPolicy: IfNotPresent
            volumeMounts:
             - mountPath: /var/lib/ghost/content
               name: ghost-blog-data
            securityContext:
              privileged: True
   volumes:
        - name: ghost-blog-data
          persistentVolumeClaim:
            claimName: pvc-ghost
        nodeSelector:
          beta.kubernetes.io/arch: arm
  
    replicas: 2
    selector:
      matchLabels:
        app: ghost-app
  
  
  kubectl get nodes --show-labels
  NAME                  STATUS   ROLES    AGE   VERSION   LABELS
  rpi-k8-workernode-2   Ready    &lt;none&gt;   93d   v1.15.0   beta.kubernetes.io/arch=arm,beta.kubernetes.io/os=linux,kubernetes.io/arch=arm,kubernetes.io/hostname=rpi-k8-workernode-2,kubernetes.io/os=linux
  rpi-mon-k8-worker     Ready    &lt;none&gt;   93d   v1.15.0   beta.kubernetes.io/arch=arm,beta.kubernetes.io/os=linux,kubernetes.io/arch=arm,kubernetes.io/hostname=rpi-mon-k8-worker,kubernetes.io/os=linux
  udubuntu              Ready    master   93d   v1.15.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=udubuntu,kubernetes.io/os=linux,node-role.kubernetes.io/master=
  
  -----------------------------------------------------------
  ud@udubuntu:~/kube-files$ kubectl describe pvc pvc-ghost -n ghost
  Name:          pvc-ghost
  Namespace:     ghost
  StorageClass:  manual
  Status:        Pending
  Volume:
  Labels:        pv=pv-ghost
  Annotations:   kubectl.kubernetes.io/last-applied-configuration:
                   {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"labels":{"pv":"pv-ghost"},"name":"pvc-ghost","namespace":"...
  Finalizers:    [kubernetes.io/pvc-protection]
  Capacity:
  Access Modes:
  VolumeMode:    Filesystem
  Mounted By:    &lt;none&gt;
  Events:
    Type    Reason                Age               From                         Message
    ----    ------                ----              ----                         -------
    Normal  WaitForFirstConsumer  6s (x2 over 21s)  persistentvolume-controller  waiting for first consumer to be created before binding
  </code></pre>