Beginners guide to Kubernetes remote storage

Saiyam Pathak avatar
By Saiyam Pathak
Director of Technical Evangelism

Description

Understanding Kubernetes remote storage and how to use the NFS volume plugin.


Transcription

What is Kubernetes remote storage?

In this video, we'll be talking about remote Kubernetes volumes. That means they live outside of the Kubernetes cluster. For example, NFS, Cloud volumes, GlusterFs, and so on. In this scenario, we have the provision of an NFS server outside of the Kubernetes cluster. In the volume section of the pod spec, you can see that we have used the volume plugin called NFS, and each volume plugin will have its own set of configurations.

What is Network File System (NFS)?

For NFS, we have a server that we have to give and the shared path. Inside the container, the volume mount is getting used for the container to use the volume. In this scenario, you have NFS over here, and container volume uses NFS, which is living outside of the Kubernetes cluster. Now, we have already discussed emptyDir and the host path.

How does NFS work?

So emptyDir is ephemeral, and the hostPath is using the nodes. So if it's spun up on another node when the port dies, it spins up again, and it might not spin up on the same node, so there might be inconsistencies. But in this scenario, when you have mounted the NFS and when the pod will again spin up on a new node, it will again mount the same NFS. This is because the NFS was living outside of the cluster, which is external to the cluster.

In this way, the data will be there even if the cluster goes down. Also, there won't be inconsistencies if the pod goes from one node to another due to eviction or any other reason. There are the remote volumes where you have to know the details when using the volume plugin. If you're using Cloud volume, you need to know the details. And if you're using NFS, you need to know the server and the path. If you are defining the pod spec, you should know all about the volume spec. That's it for this lecture. Thank you for watching, see you in the next one.

Don't stop now, check out your next lesson