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
- You have an active
ocsession with administrative permissions to the OpenShift cluster. See This page is not included, but the link has been rewritten to point to the nearest parent document.Getting started with the CLI.
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, andephemeral.Note:You can set this field at installation or update it on the command line.
Results
- Verify the
pvcStrategyvalue in theCheClusterCustom Resource:oc get checluster devspaces -n openshift-devspaces -o jsonpath='{.spec.devEnvironments.storage.pvc.pvcStrategy}'