Why you would want to use PersistentVolume
When you're creating your Pods, you have the opportunity to create volumes in order to share files between the containers created by them. However, these volumes can represent a massive problem: they are bound to the life cycle of the Pod that created them.
That is why Kubernetes offers another object called PersistentVolume
, which is a way to create storage in Kubernetes that will not be bound to the life cycle of a Pod.
Introducing PersistentVolumes
Just like the Pod of ConfigMap
, PersistentVolume
is a resource kind that is exposed through kube-apiserver
: you can create, update, and delete persistent volumes using YAML and kubectl
just like any other Kubernetes object.
The following command will demonstrate how to list the PersistentVolume
resource kind currently provisioned within your Kubernetes cluster:
$ kubectl get persistentvolume No resource found
The persistentvolume
object is also accessible with the plural...