The PersistentVolume is invalid: spec: Required value: must specify a volume type The PersistentVolume is invalid: spec: Required value: must specify a volume type kubernetes kubernetes

The PersistentVolume is invalid: spec: Required value: must specify a volume type


The PersistentVolume "sftp-pv-storage" is invalid: spec: Requiredvalue: must specify a volume type.

In PV manifest you must provide type of volume. List of all supported types are described here. As you are using Ceph I assume you will use CephFS.

A cephfs volume allows an existing CephFS volume to be mounted into your Pod. Unlike emptyDir, which is erased when a Pod is removed, the contents of a cephfs volume are preserved and the volume is merely unmounted. This means that a CephFS volume can be pre-populated with data, and that data can be “handed off” between Pods. CephFS can be mounted by multiple writers simultaneously.

Example of CephFS you can find in Github.

If I add "hostPath: path: "/mnt/data"" as a spec to the PV, it will show up as an Available PV (with a local node path), but my PVC is not bonded to it.

If you will check Official Kubernetes docs about storageClassName.

A claim can request a particular class by specifying the name of a StorageClass using the attribute storageClassName. Only PVs of the requested class, ones with the same storageClassName as the PVC, can be bound to the PVC.

storageClassName of your PV and PVC are different.

PV:

spec:  storageClassName: rook-ceph-block

PVC:

spec:  storageClassName: sftp-pv-storage

Hope it will help.


You did not specify the "hostPath:" in your PersistentVolumeAdd it and the error should be resolved. See sample below

hostPath