Tutorials:Persistent volumes on the Kubernetes cluster
Persistent volumes
A persistent volume in Kubernetes is a cluster resource which can be requested by a container. For this, you have to claim a persistent volume (PV) using a persistent volume claim (PVC), which you apply in your namespace. The persistent volume claim can then be mounted to directories within a container.
On the cluster, there are two types of persistent volumes currently configured:
- Local persistent volumes
- Host directories
Local persistent volumes
These are persistent volumes which are mapped to special folders of the host filesystem of the node. Each node exposes several persistent volumes which can be claimed. The user can not control which volume is bound to a claim, but can request a minimum size. A persistent volume claim (PVC) is configured like this:
> kubectl config use-context me@ccu
The following storage classes are configured in the cluster:
When the claim is defined to your satisfaction, apply it like this:
> kubectl config use-context me@ccu
You can check on the status of the claim:
> kubectl config use-context me@ccu
Since the claim has not been used by a container yet, it is not yet bound to a persitent volume (PV).
Host directories
Large training data sets which are required by many different users are stored permanently in the filesystem of several nodes. They can be claimed with a PVC as follows:
> kubectl config use-context me@ccu