From the course: Certified Kubernetes Administrator (CKA) Cert Prep

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Setting up persistent storage

Setting up persistent storage

- Okay, next task is about persistent storage. Create a PersistentVolume with the name lab154 that uses HostPath on the directory /lab154. So that's it, just a PersistentVolume, nothing else. That shouldn't be too hard. Again, same approach. PersistentVolume. Looking in the documentation. And I know because I've studied it before, that configure a pod to use a PersistentVolume for storage is actually quite decent as an example. Here we see the Create a PersistentVolume. So I'm going to copy this to the clipboard. And I'm pasting it to lab154.yaml. So, do we need a name? Yes, we need a name, and the name is lab154. And we don't need the labels. storageClassName, we don't need it. Does it hurt? Also doesn't hurt. We do need the capacity. We do need an accessMode, but the lab says nothing about it. So it should only check for the hostPath. And the hostPath, that would be /lab154. So kubectl apply -f on lab154. We'll do it. And just to make sure, kubectl describe the pv lab154. It's…

Contents