Table of Contents

Persistent volumes

Persistent volumes are storage which persist during & after pod's lifetime.

Persistent volumes in Rahti are stored in a resilient storage such as CEPH, NFS or GlusterFS. They are claimed by a pod using a PersistentVolumeClaim. When a new claim is made, this can mean that either an existing volume is claimed or a new one is created dynamically and given to the pod to use.

There are two storage classes available in Rahti:

  • glusterfs-storage. This kind of volume is a "Read Write Many" (RWX) type storage, this means multiple nodes can mount it in read nad write mode. This is the default class. It is the most flexible class, as allows any pod anywhere in the cluster to read and write files. The downside is a lower performance than the next class.
  • standard-rwo. This kind is a "Read Write Once" (RWO), meaning that only one node can mount the volume (in read-write mode). It is faster than glusterfs, but it is limited to a single node.


Persistent storage is requested in the cluster using PersistentVolumeClaim objects:


apiVersion: v1
kind: PersistentVolumeClaim
  name: testing-pvc
  - ReadWriteMany
      storage: 1Gi

Above will request a 1 GiB persistent storage that can be mounted in read-write mode by multiple nodes. Other access modes are ReadWriteOnce (Only one node can mount it read-write) and ReadOnlyMany (Multiple nodes can mount read-only).

Persistent storage can be requested also via the web console.

The persistent volume can be used in a pod by specifying spec.volumes (defines the volumes to attach) and spec.containers.volumeMounts (defines where to mount the attached volumes in the container's filesystem):


apiVersion: v1
kind: Pod
  name: mypod-vol
    app: serveapp-vol
    pool: servepod-vol
  - name: serve-cont
    image: "docker-registry.default.svc:5000/openshift/httpd"
    - mountPath: /mountdata
      name: smalldisk-vol
  - name: smalldisk-vol
      claimName: testing-pvc


When a Persistent Volume is deleted, the corresponding data is deleted permanently. It is highly recommended to make regular and versioned copies of the data to an independent storage system like Allas.

Last edited Mon Sep 28 2020