Binding a PVC to a local storage PV
Binding a PVC to a local storage PV¶
In order to bind a PVC to a local storage PV you can do so using the following:
- Create a PersistantVolumeClaim object like the following, simply update the
NAMESPACEto match the namespace this PVC will be created in, the
NAMEthe name of the PVC, the
SIZEthe size which matches the local storage PV and finally the
LOCAL_STORAGE_PV_NAMEto match the local storage PV's name which you wish to bind it to.
- Important, don't chose a local storage PV name which exists on a master node, as they are marked as unschedulable for user workloads.
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: NAME namespace: NAMESPACE finalizers: - kubernetes.io/pvc-protection spec: accessModes: - ReadWriteMany resources: requests: storage: SIZE volumeName: LOCAL_STORAGE_PV_NAME storageClassName: local-sc volumeMode: Filesystem