I have a Kubernetes cluster with one node (docker-desktop). The cluster has a default storage class hostpath
and created a PV as well as a corresponding PVC making use of hostpath
storage class. The PVC has successfully bound to a running pod.
As I understand, hostpath
makes use of the node’s file system as a storage location that pods can use to store files in.
My question is how can I manually access to store files to the node’s file system so that the files may be accessible by the running pod?
Please find my PV:
apiVersion: v1
kind: PersistentVolume
metadata:
name: mps-pv
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 20Gi
persistentVolumeReclaimPolicy: Retain
storageClassName: hostpath
hostPath:
path: /mnt/mps/
And my PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mps-pv-claim
namespace: mps
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: hostpath
volumeName: mps-pv
PS I am new to Kuberenetes so my question may not even be relevant here.