A hostPath volume mounts a directory from one Kubernetes node into a pod. Data remains on that node after the pod is deleted, but it is not synchronized across nodes and is lost if the node fails. section 7.1 section 7.1.1
Use these operational rules when configuring or evaluating a hostPath volume:
- Provision it as a PersistentVolume when storage must outlive the pod. section 7.1.1
- Use ReadWriteOnce (RWO); hostPath does not support ReadOnlyMany, ReadWriteMany, or ReadWriteOncePod. section 7.1.3
- Plan for node placement because moving the pod to another node can expose different or missing data. section 7.1.1
Exam-style hostPath workflow
Create a 100 MB hostPath PersistentVolume named vol02833 using /mnt/data on worker node01. Create claim-02833 requesting 90 MB, then mount the claim in a frontend0113 Deployment at /usr/share/nginx/html. Verify the claim is Bound with kubectl get pvc, the PV is Bound with kubectl get pv, and the Deployment pod is Running with kubectl get deploy and kubectl get po. section 7.1
Figure 7.7 Abbreviated output from the kubectl describe po command, which shows the volume mounted to the pod
Inspect the pod description to confirm that the configured volume is mounted inside the running pod. section 7.1

