diff --git a/modules/administration-guide/pages/devworkspace-backup-integrated-openshift-registry.adoc b/modules/administration-guide/pages/devworkspace-backup-integrated-openshift-registry.adoc index 99e35c9833..d72b1d8807 100644 --- a/modules/administration-guide/pages/devworkspace-backup-integrated-openshift-registry.adoc +++ b/modules/administration-guide/pages/devworkspace-backup-integrated-openshift-registry.adoc @@ -17,7 +17,7 @@ apiVersion: controller.devfile.io/v1alpha1 kind: DevWorkspaceOperatorConfig metadata: name: devworkspace-operator-config - namespace: $OPERATOR_INSTALL_NAMESPACE + namespace: $OPERATOR_INSTALL_NAMESPACE <1> config: routing: defaultRoutingClass: basic @@ -26,9 +26,13 @@ config: enable: true registry: path: default-route-openshift-image-registry.apps.{cluster ID}.openshiftapps.com + oras: + extraArgs: '--insecure' <2> schedule: '0 */4 * * *' # cron expression with backup frequency imagePullPolicy: Always ---- +<1> For Red Hat OpenShift, the default installation namespace for the {devworkspace} operator is `openshift-operators`. See the xref:devworkspace-operator.adoc[{devworkspace} operator overview]. +<2> The `--insecure` flag can be required depending on the integrated registry's routing configuration. **Note:** The `path` field must contain the URL to your OpenShift integrated registry given by the cluster. diff --git a/modules/administration-guide/pages/devworkspace-backup-regular-oci-registry.adoc b/modules/administration-guide/pages/devworkspace-backup-regular-oci-registry.adoc index ebb088c03e..bf85462f48 100644 --- a/modules/administration-guide/pages/devworkspace-backup-regular-oci-registry.adoc +++ b/modules/administration-guide/pages/devworkspace-backup-regular-oci-registry.adoc @@ -18,7 +18,7 @@ kind: DevWorkspaceOperatorConfig apiVersion: controller.devfile.io/v1alpha1 metadata: name: devworkspace-operator-config - namespace: $OPERATOR_INSTALL_NAMESPACE + namespace: $OPERATOR_INSTALL_NAMESPACE <1> config: routing: defaultRoutingClass: basic @@ -31,19 +31,21 @@ config: schedule: '0 */4 * * *' imagePullPolicy: Always ---- +<1> For Red Hat OpenShift, the default installation namespace for the {devworkspace} operator is `openshift-operators`. See the xref:devworkspace-operator.adoc[{devworkspace} operator overview]. The `authSecret` must point to a real {kubernetes} Secret of type `kubernetes.io/dockerconfigjson` containing credentials to access the registry. +The secret should be created in the installation {namespace} for the {devworkspace} operator. To create one, you can use the following command: [source,shell,subs="+attributes,+quotes"] ---- -kubectl create secret docker-registry my-secret --from-file=config.json -n devworkspace-controller +kubectl create secret docker-registry my-secret --from-file=config.json ---- The secret must contain a label `controller.devfile.io/watch-secret=true` to be recognized by the {devworkspace} Operator. [source,shell,subs="+attributes,+quotes"] ---- -kubectl label secret my-secret controller.devfile.io/watch-secret=true -n devworkspace-controller +kubectl label secret my-secret controller.devfile.io/watch-secret=true ---- diff --git a/modules/administration-guide/pages/devworkspace-backup.adoc b/modules/administration-guide/pages/devworkspace-backup.adoc index 35bf5f10b3..c4fc4ef0aa 100644 --- a/modules/administration-guide/pages/devworkspace-backup.adoc +++ b/modules/administration-guide/pages/devworkspace-backup.adoc @@ -14,12 +14,15 @@ integrated registry or link:https://quay.io[Quay.io], to store backup archives a The backup makes a snapshot of *stopped* Workspace PVCs and stores them as tar.gz archives in the specified OCI registry. +Users can restore backups from the {prod-short} dashboard. See xref:end-user-guide:restoring-workspaces-from-backups.adoc[]. + NOTE: By default, the {devworkspace} backup job is disabled. You can configure the backup by using the `DevWorkspaceOperatorConfig` resource with the following fields: * `enable`: Set to `true` to enable the backup job or `false` to disable it. The default value is `false`. * `schedule`: A Cron expression that defines the backup frequency. The default value is `"0 1 * * *"`. +* `backoffLimit`: The value of the backup job's `spec.backoffLimit`, which specifies the number of retries before marking this job failed. The default value for the backups jobs is `1`. * `registry.path`: The base registry location for backup archives. + The value for `registry.path` is the first segment of the final location. The full path is assembled dynamically by using the workspace name and the `:latest` tag in the following pattern: diff --git a/modules/end-user-guide/images/workspace-backup/backups_tab.png b/modules/end-user-guide/images/workspace-backup/backups_tab.png new file mode 100644 index 0000000000..e7aef6e192 Binary files /dev/null and b/modules/end-user-guide/images/workspace-backup/backups_tab.png differ diff --git a/modules/end-user-guide/images/workspace-backup/restore_section_1.png b/modules/end-user-guide/images/workspace-backup/restore_section_1.png new file mode 100644 index 0000000000..87d4e8289b Binary files /dev/null and b/modules/end-user-guide/images/workspace-backup/restore_section_1.png differ diff --git a/modules/end-user-guide/images/workspace-backup/restore_section_2.png b/modules/end-user-guide/images/workspace-backup/restore_section_2.png new file mode 100644 index 0000000000..7e12b012c1 Binary files /dev/null and b/modules/end-user-guide/images/workspace-backup/restore_section_2.png differ diff --git a/modules/end-user-guide/nav.adoc b/modules/end-user-guide/nav.adoc index 35a5c1af27..4d522887c0 100644 --- a/modules/end-user-guide/nav.adoc +++ b/modules/end-user-guide/nav.adoc @@ -17,6 +17,9 @@ **** xref:url-parameter-for-the-existing-workspace-name.adoc[] ** xref:starting-a-workspace-from-a-raw-devfile-url.adoc[] ** xref:basic-actions-you-can-perform-on-a-workspace.adoc[] +** xref:restoring-workspaces-from-backups.adoc[] +*** xref:proc-restoring-a-workspace-from-backup.adoc[] +*** xref:proc-viewing-backups-in-the-dashboard.adoc[] ** xref:authenticating-to-a-git-server-from-a-workspace.adoc[] ** xref:using-the-fuse-overlay-storage-driver.adoc[] *** xref:accessing-fuse.adoc[] diff --git a/modules/end-user-guide/pages/getting-started-with-che.adoc b/modules/end-user-guide/pages/getting-started-with-che.adoc index 56ad8d7cf0..1c8d3bef3a 100644 --- a/modules/end-user-guide/pages/getting-started-with-che.adoc +++ b/modules/end-user-guide/pages/getting-started-with-che.adoc @@ -13,5 +13,6 @@ If your organization is already running a {prod-short} instance, you can get sta * xref:optional-parameters-for-the-urls-for-starting-a-new-workspace.adoc[] * xref:starting-a-workspace-from-a-raw-devfile-url.adoc[] * xref:basic-actions-you-can-perform-on-a-workspace.adoc[] +* xref:restoring-workspaces-from-backups.adoc[] * xref:authenticating-to-a-git-server-from-a-workspace.adoc[] * xref:using-the-fuse-overlay-storage-driver.adoc[] diff --git a/modules/end-user-guide/pages/proc-restoring-a-workspace-from-backup.adoc b/modules/end-user-guide/pages/proc-restoring-a-workspace-from-backup.adoc new file mode 100644 index 0000000000..4ab6925206 --- /dev/null +++ b/modules/end-user-guide/pages/proc-restoring-a-workspace-from-backup.adoc @@ -0,0 +1,25 @@ +:_mod-docs-content-type: PROCEDURE +[id="restoring-a-workspace-from-backup_{context}"] += Restoring a workspace from a backup + +Recover uncommitted changes or recreate a workspace environment by restoring from a backup snapshot through the {prod-short} dashboard. When the restoration is complete, the dashboard opens the new workspace in a browser tab. + +.Prerequisites +* Backups are enabled for your cluster. +* You know which default registry or external registry backup image to use. +* You have identified a default registry or external registry backup image to use. + +.Procedure + +. On the Restore page, select the backup source: +** Default registry: Select a backup from the list. +** External registry: Provide a backup image URL. ++ +.Restore mode and backup source selection +image::workspace-backup/restore_section_1.png[Selecting the backup source during restoration,link="{imagesdir}/workspace-backup/restore_section_1.png"] +. Enter a name for the restored workspace. +. Optional: Configure the memory limits, CPU limits, and the editor. ++ +.Resource limits and editor selection +image::workspace-backup/restore_section_2.png[Configuring resources and editors for a restored workspace,link="{imagesdir}/workspace-backup/restore_section_2.png"] +. Click *Restore Workspace* and wait for the workspace to start. diff --git a/modules/end-user-guide/pages/proc-viewing-backups-in-the-dashboard.adoc b/modules/end-user-guide/pages/proc-viewing-backups-in-the-dashboard.adoc new file mode 100644 index 0000000000..e0ae5c77fb --- /dev/null +++ b/modules/end-user-guide/pages/proc-viewing-backups-in-the-dashboard.adoc @@ -0,0 +1,17 @@ +:_mod-docs-content-type: PROCEDURE +[id="viewing-backups-in-the-dashboard_{context}"] += Viewing backups in the dashboard + +To inspect the status of your workspace backups, view the list of available backups in the {prod-short} dashboard. +Backups displayed in the {prod-short} dashboard are backups available in the default registry set by the administrator. + +.Procedure + +. In the {prod-short} dashboard, click Workspace. +. In the {prod-short} dashboard, click *Workspaces*. +. Select the *Backups* tab to view available backups. + +.The Backups tab in the Workspace view +image::workspace-backup/backups_tab.png[The Backups tab in the Workspace view of the dashboard,link="{imagesdir}/workspace-backup/backups_tab.png"] + +The *Active* tag represents backups for workspaces that still exist in the current cluster. Conversely, the *Deleted* tag represents backups for workspaces that no longer exist in the current cluster. \ No newline at end of file diff --git a/modules/end-user-guide/pages/restoring-workspaces-from-backups.adoc b/modules/end-user-guide/pages/restoring-workspaces-from-backups.adoc new file mode 100644 index 0000000000..b320e23e5f --- /dev/null +++ b/modules/end-user-guide/pages/restoring-workspaces-from-backups.adoc @@ -0,0 +1,33 @@ +:_content-type: CONCEPT +:description: Restoring a Che workspace from a DevWorkspace backup +:keywords: workspace, backup, restore, devworkspace, dashboard +:navtitle: Restoring workspaces from backups +:page-aliases: + +[id="restoring-workspaces-from-backups"] += Restoring workspaces from backups + +When backups are enabled for {devworkspace} instances on your cluster, a cron job backs up workspace data for stopped workspaces. + +Backup storage, registry access, and schedules are configured cluster-wide by administrators in the {devworkspace} Operator. +For administrator steps, see xref:administration-guide:devworkspace-backup.adoc[]. + +Backing up and restoring workspaces allows you to recover uncommitted source code changes. Restored workspaces use a minimal devfile rather than the original project devfile. + +From the {prod-short} dashboard you can: + +* Open the list of backups and inspect backup status. +* Restore a workspace from a backup that is already available to you (*internal* backup), or from an image reference you provide (*external* backup). +* Choose compute limits and the editor for the new workspace before you start the restore. + +When the restored workspace is ready, the dashboard opens it in a new browser tab. + +[NOTE] +==== +A restored workspace is created from a minimal devfile with the restored source code being transferred to the workspace from an init container. +The *Devfile* tab in the workspace will not show the original devfile from the workspace's Git repository. +==== + +include::proc-viewing-backups-in-the-dashboard.adoc[leveloffset=+1] + +include::proc-restoring-a-workspace-from-backup.adoc[leveloffset=+1]