Enable fuse-overlayfs for all workspaces

Enable the fuse-overlayfs storage driver for all workspaces on the cluster by adding the required pod annotation to the CheCluster Custom Resource.

Prerequisites
Procedure
  1. Set the necessary annotation in the spec.devEnvironments.workspacesPodAnnotations field of the CheCluster custom resource.

    kind: CheCluster
    apiVersion: org.eclipse.che/v2
    spec:
      devEnvironments:
        workspacesPodAnnotations:
          io.kubernetes.cri-o.Devices: /dev/fuse

    For OpenShift versions before 4.15, the io.openshift.podman-fuse: "" annotation is also required.

    The Universal Development Image (UDI) includes the following logic in the entrypoint script to detect fuse-overlayfs and set the storage driver. If you use a custom image, you should add an equivalent logic the image’s entrypoint.

    if [ ! -d "${HOME}/.config/containers" ]; then
      mkdir -p ${HOME}/.config/containers
      if [ -c "/dev/fuse" ] && [ -f "/usr/bin/fuse-overlayfs" ]; then
        (echo '[storage]';echo 'driver = "overlay"';echo '[storage.options.overlay]';echo 'mount_program = "/usr/bin/fuse-overlayfs"') > ${HOME}/.config/containers/storage.conf
      else
        (echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf
      fi
    fi
Verification
  1. Start a workspace and verify that the storage driver is overlay.

    $ podman info | grep overlay

    Example output:

    graphDriverName: overlay
      overlay.mount_program:
        Executable: /usr/bin/fuse-overlayfs
        Package: fuse-overlayfs-1.12-1.module+el8.9.0+20326+387084d0.x86_64
          fuse-overlayfs: version 1.12
      Backing Filesystem: overlayfs

    The following error might occur for existing workspaces:

    ERRO[0000] User-selected graph driver "overlay" overwritten by graph driver "vfs" from database - delete libpod local files ("/home/user/.local/share/containers/storage") to resolve.  May prevent use of images created by other tools

    In this case, delete the libpod local files as mentioned in the error message.