Kubernetes Volumes 1: emptydir, NFS, YAML, volumes, and intro to Persistent Volume Claims

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to look at kubernetes volumes for lots of really great information go to this page on the kubernetes website so first of all what problem does occur burn eddies volume tried to solve well remember that you have a node and inside the nodes you have a pod or multiple pods and inside the pods you're going to have a container possibly multiple containers inside a given pod but remember that pods are ephemeral they come and go and potentially very often so what happens if you have data that you must keep even though the pod itself may go down the idea is to move it outside of the pod so it can exist independently of any pod and although we are calling it a volume the benefit that it brings you really is state you can persist a state across multiple pods so you can have user names and addresses and files all exist independently of whether the pod is running and all of that is explained here on disk files in a container are ephemeral unless you create a volume so kubernetes exposes multiple kinds of volumes and we're going to start with the empty volume empty der as its called because when you create an empty der its contents are initially empty and the idea here is that your node can store the contents that you want in a volume that will run either in RAM or in persistent storage on a drive like SSD or hard drive that's not SSD now notice that this type of storage runs on the node which means it's only as good as the node is running if the node itself goes down you will lose the contents the yamo for this would look like the following and there are a couple of features that you'll see across most of these definitions you'll have a volumes section or a node here which has a name and empty der in this case and you can see it is indeed empty and you also have volume amounts now the mounts will do exactly what it says it will create amount and then load whatever volumes are listed here and here you can see an example where we're using Ram that example comes from this book here now if you don't want your directory to start out empty you use was called host path and connected essentially the same way so if your host the node here has some path called /foo then the host path would allow that to be mounted ok now let's take a look at cloud volumes and by cloud volumes I'm really talking about GCE and AWS and similar volume with cloud volumes you're essentially creating a yamo file that tells the pod to connect to one of the providers elastic block service or the persistent disk or SSD something along these lines and you can see that here there's the pod here's the volume mounts they're gonna do a slash test ABS and then the data the connectivity information is really here AWS elastic block search the volume ID and the FS type but the problem here is that if you as the user are configuring this new pod you have to know all of that information meaning you need to know the volume ID the filesystem type and other low-level details requiring users to know that level of detail may not be practical in your environment and we'll see you soon that you can avoid that by using what's called a persistent volume claim or PVC but before we do that let's look at NFS or the network file system which is really sort of like Windows sharing if you're familiar with that which lets you connect a volume over NFS at the pod level also through a llamó file and you can see that once the pod is removed that the volume is still available it's just unmounted but something really interesting is if you look at the NFS example it will tell you in step 1 to go to this file and this file is a persistent volume climb so even their example isn't really telling you how to connect like this it wants you to use a persistent volume climb so what is that in a PVC as it's known the node and more specifically the pod is going to connect through a series of abstractions and those abstractions will give you access to the underlying cloud provided back-end storage volumes now the advantage of that is that you as a user not as an administrator can provide the subtraction and still get to the volume ID and fs type without actually providing any of that detail and this also sets you for Federation where your volumes can actually span across multiple providers and this way have increased resiliency now those are the main kubernetes volume types now how do you use them
Info
Channel: Sean Wingert
Views: 46,751
Rating: 4.9300971 out of 5
Keywords:
Id: VB7vI9OT-WQ
Channel Id: undefined
Length: 4min 41sec (281 seconds)
Published: Wed Oct 18 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.