このコンテンツは選択した言語では利用できません。

Chapter 18. Back up OpenShift Dev Spaces workspaces


Back up OpenShift Dev Spaces workspace data to an OCI-compatible registry on a recurring schedule.

The Dev Workspace backup controller creates periodic snapshots of stopped workspace PVCs and stores them as tar.gz archives in a target registry. Supported registries include the OpenShift Container Platform integrated registry and Quay.io. Configure the backup schedule, target registry, and authentication by editing the DevWorkspaceOperatorConfig resource.

The backoffLimit field sets the number of retries before marking the backup job as failed. The default value is 1.

Note

By default, the Dev Workspace backup job is disabled.

18.1. Configure backup with the integrated OpenShift registry

Configure the Dev Workspace backup job to use the integrated OpenShift Container Platform container registry. This option requires no additional authentication configuration.

Prerequisites

Procedure

  1. Configure the DevWorkspaceOperatorConfig resource to enable the backup job:

    apiVersion: controller.devfile.io/v1alpha1
    kind: DevWorkspaceOperatorConfig
    metadata:
      name: devworkspace-operator-config
      namespace: openshift-operators
    config:
      workspace:
        backupCronJob:
          enable: true
          registry:
            path: <integrated_registry_url>
          oras:
            extraArgs: '--insecure'
          schedule: '0 */4 * * *'
        imagePullPolicy: Always

    where:

    openshift-operators
    The default installation namespace for the Dev Workspace Operator on OpenShift. If the Dev Workspace Operator is installed in a different namespace, use that namespace instead.
    <integrated_registry_url>
    The URL to the OpenShift Container Platform integrated registry for your cluster.
    --insecure
    The --insecure flag may be required depending on the integrated registry’s routing configuration.
  2. Get the default path to the integrated registry:

    echo "$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')"

Verification

  • After the backup job completes, verify that the backup archives are available in the integrated registry. Check the Dev Workspace project for a repository with a matching Dev Workspace name.
Note

If the installation project for the Dev Workspace Operator is not openshift-operators, you must define it as an environment variable for the Red Hat OpenShift Dev Spaces dashboard in the CheCluster Custom Resource.

apiVersion: org.eclipse.che/v2
kind: CheCluster
spec:
  components:
    dashboard:
      deployment:
        containers:
          - env:
              - name: DWO_NAMESPACE
                value: <operator_install_namespace>
            name: che-dashboard

+ where:

+ <operator_install_namespace>:: The project where the Dev Workspace Operator is installed. The default installation project for the Dev Workspace Operator on OpenShift is openshift-operators.

For more information, see Section 2.3.3, “Dev Workspace operator”.

18.2. Configure backup with a regular OCI-compatible registry

Configure the Dev Workspace backup job to use a regular OCI-compatible registry for backups. Provide registry credentials through a Kubernetes Secret in the Operator project or in each Dev Workspace project.

A Secret in the Dev Workspace project enables using different registry accounts per project with more granular access control.

Prerequisites

  • You have administrator access to the OpenShift cluster.
  • You have credentials for an OCI-compatible registry such as Quay.io.

Procedure

  1. Configure the DevWorkspaceOperatorConfig resource to enable the backup job:

    kind: DevWorkspaceOperatorConfig
    apiVersion: controller.devfile.io/v1alpha1
    metadata:
      name: devworkspace-operator-config
      namespace: openshift-operators
    config:
      workspace:
        backupCronJob:
          enable: true
          registry:
            authSecret: devworkspace-backup-registry-auth
            path: <registry_url>
          schedule: '0 */4 * * *'
        imagePullPolicy: Always

    where:

    openshift-operators
    The default installation namespace for the Dev Workspace Operator on OpenShift. If the Dev Workspace Operator is installed in a different namespace, use that namespace instead.
    <registry_url>

    The OCI registry URL. For example: quay.io/my-company-org.

    The authSecret must be named devworkspace-backup-registry-auth. It must reference a Kubernetes Secret of type kubernetes.io/dockerconfigjson that contains credentials to access the registry. Create the Secret in the installation project for the Dev Workspace Operator.

  2. Create the registry credentials Secret:

    oc create secret docker-registry devworkspace-backup-registry-auth --from-file=config.json -n openshift-operators
  3. Add the required label to the Secret for the Dev Workspace Operator to recognize it:

    oc label secret devworkspace-backup-registry-auth controller.devfile.io/watch-secret=true -n openshift-operators
    Warning

    The Dev Workspace Operator copies the devworkspace-backup-registry-auth Secret to each Dev Workspace project so that backups from user workspaces can be pushed to the registry. To use different credentials per project, create a devworkspace-backup-registry-auth Secret with user-specific credentials in each Dev Workspace project instead.

Verification

  • After the backup job completes, verify that the backup archives are available in the OCI registry under the expected path.
Note

If the installation project for the Dev Workspace Operator is not openshift-operators, you must define it as an environment variable for the Red Hat OpenShift Dev Spaces dashboard in the CheCluster Custom Resource.

apiVersion: org.eclipse.che/v2
kind: CheCluster
spec:
  components:
    dashboard:
      deployment:
        containers:
          - env:
              - name: DWO_NAMESPACE
                value: <operator_install_namespace>
            name: che-dashboard

+ where:

+ <operator_install_namespace>:: The project where the Dev Workspace Operator is installed. The default installation project for the Dev Workspace Operator on OpenShift is openshift-operators.

For more information, see Section 2.3.3, “Dev Workspace operator”.

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る