Search code examples
eclipse-che

How does eclipse che backup running workspaces?


I had a look at the overall architecture of Eclipse Che from here. https://www.eclipse.org/che/docs/che-7/che-architecture.html#high-level-che-architecture_che-architectural-elements

But there is no info on how container workspaces are persisted in case of a container crash / cluster machine crash. Is it handled by kubernetes or Container workspaces controller.


Solution

  • If you configure your workspaces to be persistent (and there is an option to have them be ephemeral, in which case there is no persistent storage), then a Persistent Volume Claim is made for the workspace, and that PVC is made available inside each container in the workspace, as a shared volume. Any files written to the shared volume by Che (or by any other method) will be persisted by the storage back-end - and that's a Kubernetes construct.

    In Kubernetes, either a "StorageClass" is defined to say what to do with persistent volume claims (allocate a new Ceph block device for a volume, for example), or the cluster admin has pre-created Persistent Volumes (as, for example, NFS shares) which can, if they are available, be matched with the claim.

    There is one important Che config option that affects this - Che can be configured to use a PVC per workspace (very wasteful, if your source code and build files are only going to be a few megabytes, and you've allocated a 1G or 2G volume), or to use one large PVC for all workspaces (more of a security concern, but for most deployments, this will be the convenient option). You can find information on this configuration here in the section "how the Che server uses PVCs and PVs for storage": https://www.eclipse.org/che/docs/che-6/kubernetes-admin-guide.html