Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no persistent volumes available for this claim and no storage class is set

Tags:

kubernetes

my pvc.yaml

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: database-disk
  labels:
    stage: production
    name: database
    app: mysql
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 2Gi

when i ran kubectl apply -f pvc.yaml i got the following error Normal FailedBinding 12h (x83 over 13h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set

same pvc worked fine on "GKE" (Google Kubernetes Engine) but failing in my local cluster using microk8s

like image 662
invariant Avatar asked Sep 07 '18 22:09

invariant


1 Answers

Did you create any PV in your cluster?

PV and Storage classes on local clusters should be done manually by cluster admin.

Check out Kubernetes documentation for the details:

  1. A cluster administrator creates a PersistentVolume that is backed by physical storage. The administrator does not associate the volume with any Pod.

  2. A cluster user creates a PersistentVolumeClaim, which gets automatically bound to a suitable PersistentVolume.

  3. The user creates a Pod that uses the PersistentVolumeClaim as storage.

like image 121
VASャ Avatar answered Sep 18 '22 16:09

VASャ