3.8 Disk usage in Tiken OpenShift

Last modified by aulembin@helsinki_fi on 2024/02/07 06:33

General information about disk usage in OpenShift and Kubernetes platforms

https://kubernetes.io/docs/concepts/storage/persistent-volumes/

In principle, all changes inside a container will be lost when the container is shutdown and deleted. All data you wish to keep must be saved to a disk partition or directory outside the container.

Storing persistent data in Kubernetes hapepns by using the abstractions PersistentVolume (PV) and PersistentVolumeClaim (PVC). 

  • PersistentVolume (pv) is a cluster wide object, with which the cluster references a mountable disk.
  • PersistentVolumeClaim (pvc) is a namespace or "OpenShift project" level object, with which a Pod can reference a PersistentVolume.
  • By joining these two together, a container in a Pod can write to a disk in persistent storage.

In the spec part of the Pods definitions, a VolumeMount is given to the Pod.  A volumemount references a PVC object. After the PVC object is tied to the PV object, Kubernetes will make sure that the Pod is run on the same platform Node. This is required for the Pod to have access to a slice of persistent storage.

Tike Openshift and disk mounts


In Tike Openshift platform all PersistentVolumes come straight from VMWare's storage with dynamic provisioning.

A project with an appropriate Quota, can define its own PersistentVolumeClaim objects, and the platform will automatically create a disk (PersistentVolume) and bring it to use.

However, the University has decentralized  the storage to for the container platform to two separate subsystems, and a project must define StorageClassName in the PersistentVolumeClaim, which will direct the disk to come from the right subsystem. Each project only has disk space from one subsystem. The container platform administration will choose, from which subsystem the project should get storage from. The information of the correct subsystem will be given in the acceptance email of the project order.

Example:

If your project has disk space with the StorageClassName "pomppa24", you can access 10 gigabytes of storage with the following PersistentVolumeClaim:


apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: projects-persistentvolumeclaim
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: pomppa24


The Pod's volume definition will reference the PVC named "projects-persistentvolumeclaim".

If you do not know which StorageClassName your project has access to, you can check it by:

$ oc describe resourcequotas
Name:                                                                        default-resource-quotas
Namespace:                                                                   xxxxxxxx
Resource                                                                     Used    Hard
--------                                                                     ----    ----
nappi-talusta-sata-03-sc.storageclass.storage.k8s.io/persistentvolumeclaims  0       0
persistentvolumeclaims                                                       0       10
pomppa24.storageclass.storage.k8s.io/persistentvolumeclaims                  0       10
pomppa25.storageclass.storage.k8s.io/persistentvolumeclaims                  0       0
thin.storageclass.storage.k8s.io/persistentvolumeclaims                      0       0
.
.
.

In the above example we can see that the project has permission to have ten PersistentVolumeClaims in pomppa24, and no claim to the other StorageClassNames.

Preconditions for diskspace in Tike container platform at the moment

Check the page Preconditions for projects on the container platform. As a reminder, things related to disk space:

  • The disks are virtual disks from VMWare's dynamic provisions, which are limited to only one Node (underlying virtual machine) at a time. 
  • Cluster wide automatic backups are not (yet) configured for project data. Make sure to keep your own backups for your project.


Contact information

The recommended contact for questions is:

https://helsinkifi.slack.com #kontit 

All changes related to resources for the project/namespace should be emailed to:

grp-openshift-owner@helsinki.fi (platform administration and development)tike-ohjelmistotuotanto@helsinki.fi (program development)