Managing backups using custom resources

This section describes how to create backups of Che installation and recover directly using Custom Resource objects.

Prerequisites
  • Eclipse Che Operator can automatically configure a backup server inside the same cluster; however, it is not recommended for production use.

  • Users who agreed to the limitations coming from the decision to back up their data inside the same Kubernetes namespace or OpenShift project as Che installation may skip this section.

Creating a new backup

  1. Create a CheClusterBackup object to create a new backup:

    apiVersion: org.eclipse.che/v1
    kind: CheClusterBackup
    metadata:
      name: Che-backup
    spec:
      backupServerConfigRef: backup-server-configuration (1)
1 Name of the CheBackupServerConfiguration object defining what backup server to use.
  • The creation of a CheClusterBackup object starts a new backup.

  • Before reusing the same name for a new backup object, delete the old object:

    kubectl delete CheClusterBackup <name> -n eclipse-che

Editing the CheClusterBackup objects has no effect.

Alternative

To use the internal backup server, request automatic configuration from Che Operator. The preparation described above is not required.

  • Configure the automatic setup and sending of the backup to the internal backup server:

    apiVersion: org.eclipse.che/v1
    kind: CheClusterBackup
    metadata:
      name: Che-backup
    spec:
      useInternalBackupServer: true

Restoring from a backup

  1. Create a new object of CheClusterRestore to recover a Che installation from a backup:

    apiVersion: org.eclipse.che/v1
    kind: CheClusterRestore
    metadata:
      name: Che-restore
    spec:
      backupServerConfigRef: backup-server-configuration (1)
      snapshotId: ba92c7e0                               (2)
1 Name of the CheBackupServerConfiguration object that defines what backup server to use.
2 Optional parameter defining the Snapshot ID to restore from. The default value is the last snapshot on the backup server.
  1. Create a new CheClusterRestore object to request a new recovery.

    • Before reusing the same name for a new backup object, delete the old object first:

      kubectl delete CheClusterBackup <name> -n eclipse-che
  2. Wait until the recovery process finishes.

    In a case of errors occurrences in your browser after the recovery, clean up the browser data for the Che domain.

Editing of CheClusterRestore objects has no effect.

Verification
  1. Verify backup process state:

    1. Read the status section of the CheClusterBackup object to check the backup process:

      status:
        message: 'Backup is in progress. Start time: <timestamp>' (1)
        stage: Collecting Che installation data          (2)
        state: InProgress                                         (3)
        snapshotId: ba92c7e0                                      (4)
      1 Displays the overall state or error message.
      2 Current phase of the backup process in a human-readable format.
      3 Backup process state. One of InProgress, Succeeded, or Failed.
      4 ID of the created backup snapshot. The field appears only when state is Succeeded.
  2. Verify recovery process state

    1. Read the status section of the CheClusterRestore object to check the recovery process:

      status:
        message: 'Restore is in progress. Start time: <timestamp>' (1)
        stage: Restoring Che related cluster objects      (2)
        state: InProgress                                          (3)
      1 Overall state or error message.
      2 Current phase of the recovery process in a human-readable format.
      3 Recovery process state. One of InProgress, Succeeded, or Failed.