Configuring storage classes

To configure Che to use a configured infrastructure storage, install Che using storage classes. This is especially useful when a user wants to bind a persistent volume provided by a non-default provisioner. To do so, a user binds this storage for the Che data saving and sets the parameters for that storage. These parameters can determine the following:

  • A special host path

  • A storage capacity

  • A volume mod

  • Mount options

  • A file system

  • An access mode

  • A storage type

  • And many others

Che has one component that requires persistent volumes to store data: A Che workspace. Che workspaces store source code using volumes, for example the /projects volume.

Che workspaces source code is stored in the persistent volume only if a workspace is not ephemeral.

Persistent volume claims facts:
  • Che does not create persistent volumes in the infrastructure.

  • Che uses persistent volume claims (PVC) to mount persistent volumes.

  • The Che server creates persistent volume claims.

    A user defines a storage class name in the Che configuration to use the storage classes feature in the Che PVC. With storage classes, a user configures infrastructure storage in a flexible way with additional storage parameters. It is also possible to bind a static provisioned persistent volumes to the Che PVC using the class name.


Use the CheCluster Custom Resource definition to define storage classes:

  1. Define storage class names: configure the CheCluster Custom Resource, and install Che. See Using chectl to configure the CheCluster Custom Resource during installation.

            # keep blank unless you need to use a non default storage class for workspace PVC(s)
            storageClass: 'workspace-storage'
  2. Define the persistent volume for a Che workspace in a che-workspace-pv.yaml file:

    che-workspace-pv.yaml file
    apiVersion: v1
    kind: PersistentVolume
      name: workspace-pv-volume
        type: local
      storageClassName: workspace-storage
        storage: 10Gi
        - ReadWriteOnce
        path: "/data/che/workspace"
  3. Bind the persistent volume:

    $ kubectl apply -f che-workspace-pv.yaml

You must provide valid file permissions for volumes. You can do it using storage class configuration or manually. To manually define permissions, define storageClass#mountOptions uid and gid.