1,617 bytes added,
6 years ago == 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 using a persistent volume claim, 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 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:
<syntaxhighlight lang="yaml">
> kubectl config use-context me@ccu
</syntaxhighlight>
The following storage classes are configured in the cluster:
When the claim is defined to your satisfaction, apply it like this:
<syntaxhighlight lang="yaml">
> kubectl config use-context me@ccu
</syntaxhighlight>
You can check on the status of the claim:
<syntaxhighlight lang="yaml">
> kubectl config use-context me@ccu
</syntaxhighlight>
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:
<syntaxhighlight lang="yaml">
> kubectl config use-context me@ccu
</syntaxhighlight>