Skip to content

Commit

Permalink
procedures: Document Che storage strategies & storage size configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
AObuchow authored and AObuchow committed Jan 10, 2023
1 parent b5ee65f commit 0f53a5b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
*** xref:configuring-routes.adoc[]
** xref:configuring-storage.adoc[]
*** xref:installing-che-using-storage-classes.adoc[]
*** xref:configuring-che-storage-strategy.adoc[]
** xref:managing-identities-and-authorizations.adoc[]
*** xref:oauth-for-github-gitlab-or-bitbucket.adoc[]
**** xref:configuring-oauth-2-for-github.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:_content-type: CONCEPT
:description: Configuring the {prod-short} storage strategy
:keywords: administration guide, configuring-che-storage-strategy, configuring-che-storage-size
:navtitle: Configuring the {prod-short} storage strategy
:page-aliases: installation-guide:configuring-che-storage-strategy.adoc

[id="configuring-{prod-id-short}-storage-strategy"]
= Configuring the storage strategy

{prod-short} can be configured to provide persistent or non-persistent storage to workspaces by selecting a storage strategy. The selected storage strategy will be applied to all newly created workspaces by default. Users can opt for a non-default storage strategy for their workspace in their xref:end-user-guide:requesting-persistent-storage-for-workspaces.adoc[devfile] or through the xref:end-user-guide:url-parameter-for-the-workspace-storage.adoc[URL parameter].

.Available storage strategies:

* `per-user`: Use a single PVC for all workspaces created by a user.
* `per-workspace`: Each workspace is given its own PVC.
* `ephemeral`: Non-persistent storage; any local changes will be lost when the workspace is stopped.

The default storage strategy used in {prod-short} is `per-user`.

.Procedure

Use CheCluster Custom Resource definition to define the storage strategy:

Set the `pvcStrategy` field in the Che Cluster Custom Resource to `per-user`, `per-workspace` or `ephemeral`. To set this field prior to installing {prod-short}, see xref:using-chectl-to-configure-the-checluster-custom-resource-during-installation.adoc[], otherwise consult xref:using-the-cli-to-configure-the-checluster-custom-resource.adoc[].

[source,yaml,subs="+quotes,+attributes"]
----
spec:
devEnvironments:
storage:
pvc:
# the available storage strategies are 'per-user', 'per-workspace' and 'ephemeral'
pvcStrategy: 'per-user'
----


[id="configuring-{prod-id-short}-workspace-pvc-size"]
== Configuring the storage size

The persistent volume claim (PVC) size can be configured when using the `per-user` or `per-workspace` storage strategies. PVC sizes in the Che Cluster Custom Resource must be specified in the format of a https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/[{kubernetes} resource quantity].

.Default persistent volume claim sizes:

* `per-user`: `10Gi`
* `per-workspace`: `5Gi`

.Procedure

Use CheCluster Custom Resource definition to define the persistent volume claim size for the desired storage strategy:

Set the appropriate `claimSize` field for the desired storage strategy in the Che Cluster Custom Resource. To set this field prior to installing {prod-short}, see xref:using-chectl-to-configure-the-checluster-custom-resource-during-installation.adoc[], otherwise consult xref:using-the-cli-to-configure-the-checluster-custom-resource.adoc[].

[source,yaml,subs="+quotes,+attributes"]
----
spec:
devEnvironments:
storage:
pvc:
# the claimSize field that will be used depends on the selected pvcStrategy
# in this example, a persistent volume claim size of 15Gi will be used as the selected pvcStrategy is 'per-user'
pvcStrategy: 'per-user'
perUserStrategyPvcConfig:
# keep blank unless you need to use a non default persistent volume claim size
claimSize: 15Gi
perWorkspaceStrategyPvcConfig:
# keep blank unless you need to use a non default persistent volume claim size
claimSize: 2Gi
----
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
= Configuring storage

* xref:installing-che-using-storage-classes.adoc[]
* xref:configuring-che-storage-strategy.adoc[]

0 comments on commit 0f53a5b

Please sign in to comment.