HostPath Volume
Step 1: Verify the volume folder is available on all the nodes of Kubernetes Cluster
ls /mnt/data/volStep 2: Create a Persistent Volume
kubectl create -f 01-Persistent-Volume.yamlStep 3: Verify the Volumes
kubectl get pvStep 4: Show more details about the Volume
kubectl get pv vol-x -o yamlStep 5: Create Persistent Volume
kubectl apply -f 02-Persistent-Volume-Claim.yamlStep 6: Verify the PVC Status
kubectl get pvcStep 7: Describe and Verify the PVC
kubectl describe pvc http-claimStep 8: Create and Run the application pod
kubectl apply -f 03-app.yamlStep 9: Now try to access the pod and see the application
Step 9: Add data to the Volume
Give permissions
Step 11: Now Lets change the Value, by being inside the container
Step 12: Lets Delete the Pod and see weather data persists or not
Step 13: Check PVC
Step 14: Create a new pod with older Volume
Step 15: Verify weather we are able to read the index.html using the new pod
Access the Pod IP using CURL and check the output
Sample CURL Statement : curl http://nodeip
Clear Everything in the current namespace
Run the Below command on those Nodes, where you have created the mount path.
If you are not aware then run this below command on all the nodes.
Last updated
Was this helpful?