In the pod spec, we have defined the volume section, and in the volume section, we have used the PersistentVolumeClaim that we just created, PVC-nfs. And in the container section, we have used image alpine, and in the volumeMount section, we have mounted that inside the container under the /mnt directory. And this particular pod will just cut out the memory info and store that as a memory.txt file. In the NFS server, it should also be creating this particular file. Let's go ahead and create this pod using kubectl create -f pod.yaml. The pod is created, and it's running. We can do an exec using kubectl exec -it pod-using-nfs - sh. And let's go to the mnt directory with cd /mnt. We should see a memory.txt file, and you can see there is data in it as well.
Now, I have an NFS server already opened, and previously you can see it didn't have any data, so let's do ls again. Now, it should have the memory.txt, and it is also getting updated. We can see how an NFS server situated outside the cluster can be used as a PersistentVolume inside a pod. This is a scenario that can be used in production as well, where you have a volume outside of the cluster so that even if the cluster goes down, your data remains safe and can be recoverable. That's it for this lecture. Thank you for watching. See you in the next one.