Question
Create a Persistent Volume with the given specification
Volume name: pv-rnd
Storage: 100Mi
Access modes: ReadWriteMany
Host Path: /pv/host_data-rnd
Answer
Go to Kubernetes Documentation page and grab the template for PersistentVolume, modify it as following:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-rnd
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteMany
hostPath:
path: "/pv/host_data-rnd"
Apply and check:
kubectl apply -f pv.yaml
kubectl get pv
kubectl describe pv pv-rnd