Choose how workspace data is persisted

Choose a storage strategy for OpenShift Dev Spaces to provide persistent or non-persistent storage to workspaces. The selected strategy applies to all newly created workspaces by default.

Before you begin

About this task

Available storage strategies:

  • per-user: Use a single PVC for all workspaces created by a user.
  • per-workspace: Each workspace gets its own PVC.
  • ephemeral: Non-persistent storage; any local changes are lost when the workspace is stopped.

The default storage strategy used in OpenShift Dev Spaces is per-user.

Procedure

Set the pvcStrategy field in the CheCluster Custom Resource to per-user, per-workspace, or ephemeral:
spec:
  devEnvironments:
    storage:
      pvc:
        pvcStrategy: 'per-user'

where:

pvcStrategy

The available storage strategies are per-user, per-workspace, and ephemeral.

Note:

You can set this field at installation or update it on the command line.

Results

  • Verify the pvcStrategy value in the CheCluster Custom Resource:
    oc get checluster devspaces -n openshift-devspaces -o jsonpath='{.spec.devEnvironments.storage.pvc.pvcStrategy}'