.. SPDX-FileCopyrightText: 2024 Univention GmbH
..
.. SPDX-License-Identifier: AGPL-3.0-only

.. _backup-restore-requirements:

Requirements for backup and restore
===================================

This documentation uses the third-party open source application :program:`Velero` for backup and restore.
It provides tools for backing up and restoring Kubernetes cluster resources and persistent volumes.
The server component of :program:`Velero` runs in your Kubernetes cluster in a dedicated namespace.
The command-line client controls the server component and runs locally.

Before you can create a backup and a restore,
you must ensure to meet the following requirements:

* Requirements for the backup tool:

  #. You select the backup tool version and plugins
     that are compatible with the version of your Kubernetes cluster.

  #. You have an S3-compatible object storage,
     and the storage provider is compatible with the selected backup.

  #. You have credentials to write to the object storage and it has an appropriate bucket.

  #. Your cluster and your controlling client must be able
     to reach the object storage through proper networking and DNS resolution.

  #. For :program:`Velero`: You have installed the command-line client on a local machine,
     and the binary is in your path.

  .. note::

     You may use a backup tool of your choice that's capable of the similar functionality
     as described with Velero in this documentation.

* Requirements for the storage target: The target locates **outside** the Kubernetes cluster
  where you deployed Nubus, to allow for recovery in case the entire cluster fails.

* Requirements for the Kubernetes cluster:

  #. Your cluster has Container Storage Support (CSI) enabled to allow CSI-backed snapshots.

  #. Your cluster supports volume snapshots and you have configured ``VolumeSnapshotClasses``.

.. important::

   You need to run the backups for external services, such as the database,
   at the same time as the backup for Nubus.

.. seealso::

   For more information about :program:`Velero`,
   see the following resources:

   * `Velero Website <https://velero.io/>`_
   * `Velero documentation <https://velero.io/docs/latest/>`_
   * `Velero compatibility matrix <https://github.com/vmware-tanzu/velero?tab=readme-ov-file#velero-compatibility-matrix>`_
   * `Velero supported storage providers <https://velero.io/docs/latest/supported-providers/>`_
   * `Container Storage Interface Snapshot Support in Velero <https://velero.io/docs/latest/csi/>`_
