[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Installing applications from Cloud Marketplace > Installing Velero

# Installing Velero


[Velero](https://velero.io/) is a tool for backing up, recovering, and migrating [Managed Service for Kubernetes cluster](../../concepts/index.md#kubernetes-cluster) objects, including [persistent volumes](../../concepts/volume.md#persistent-volume). With Velero, you can:
* Prevent data losses using a flexible backup system.
* Recover a Managed Service for Kubernetes cluster faster if it goes down.
* Migrate your data from one Managed Service for Kubernetes cluster to another.

Velero uses the Container Storage Interface driver to [create backups](../../tutorials/kubernetes-backup.md) and restore persistent volumes from Yandex Cloud [disk snapshots](../../../compute/concepts/snapshot.md).

## Getting started {#before-you-begin}

1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

1. [Create a service account](../../../iam/operations/sa/create.md) to access [Yandex Object Storage](../../../storage/index.md).

   ```bash
   yc iam service-account create --name <service_account_name>
   ```

1. [Assign](../../../iam/operations/sa/assign-role-for-sa.md) the `storage.editor` role to the service account:

   ```bash
   yc resource-manager folder add-access-binding <folder_ID> \
     --role storage.editor \
     --subject serviceAccount:<service_account_ID>
   ```

1. [Create a static access key](../../../iam/operations/authentication/manage-access-keys.md#create-access-key) for your [service account](../../../iam/concepts/users/service-accounts.md).

   * If installing Velero [in the management console from Yandex Cloud Marketplace](#marketplace-install), create a static key in JSON format and save it to the `sa-key.json` file:

     ```bash
     yc iam access-key create \
       --service-account-name=<service_account_name> \
       --format=json > sa-key.json
     ```

   * If installing Velero using a [Helm chart](#helm-install), run the following command and save the `key_id` and `secret` key you get:

     ```bash
     yc iam access-key create \
       --service-account-name=<service_account_name>
     ```

1. [Create an Object Storage bucket](../../../storage/operations/buckets/create.md).

1. [Make sure](../connect/security-groups.md) the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If a rule is missing, [add it](../../../vpc/operations/security-group-add-rule.md).

    {% note warning %}
    
    The configuration of security groups determines performance and availability of the cluster and the services and applications running in it.
    
    {% endnote %}

1. Make sure you have enough disk snapshot and disk size quotas to create a backup. To do this, you can use the [service for viewing quotas](../../../quota-manager/operations/read-quotas.md).

## Installation from Yandex Cloud Marketplace {#marketplace-install}

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Managed Service for&nbsp;Kubernetes**.
1. Click the name of the Managed Service for Kubernetes cluster you need and select the ![image](../../../_assets/console-icons/shopping-cart.svg) **Marketplace** tab.
1. Under **Application available for installation**, select [Velero](https://yandex.cloud/en/marketplace/products/yc/velero-yc-csi) and click **Go to install**.
1. Configure the application:
   * **Namespace**: Create a new [namespace](../../concepts/index.md#namespace) named `velero`. The application uses it by default. If you leave the default namespace, Velero may work incorrectly.

     {% note info %}

     If you create a namespace with a different name, you will need to specify it in every command using the `--namespace <Velero_application_namespace>` parameter.

     {% endnote %}

   * **Application name**: Specify the application name.
   * **Object Storage static access key**: Copy the contents of the `sa-key.json` file or create a new [access key](../../../iam/concepts/authorization/access-key.md) for the service account. The service account must have the `storage.editor` role.
   * **Object Storage bucket name**: Specify the name of the Object Storage bucket.
1. Click **Install**.
1. Wait for the application status to change to `Deployed`.

## Installation using a Helm chart {#helm-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.
1. [Install kubect](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).
1. To install a [Helm chart](https://helm.sh/docs/topics/charts/) with Velero, run the following command, specifying the parameters of the resources you created [earlier](#before-you-begin):

   ```bash
   helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/velero/chart/velero \
        --version 8.5.0-5 \
        --untar && \
   helm install \
        --namespace velero \
        --create-namespace \
        --set backupStorageLocationCustom.bucket=<bucket_name> \
        --set serviceaccountawskeyvalue_generated.accessKeyID=<key_ID> \
        --set serviceaccountawskeyvalue_generated.secretAccessKey=<secret_key> \
        velero ./velero/
   ```

   {% note info %}
   
   If you are using a Helm version below 3.8.0, add the `export HELM_EXPERIMENTAL_OCI=1 && \` string at the beginning of the command to enable [Open Container Initiative](https://opencontainers.org/) (OCI) support in the Helm client.
   
   {% endnote %}

## See also {#see-also}

* [Velero documentation](https://velero.io/docs/v1.11/examples/)
* [Backing up a Managed Service for Kubernetes cluster to Object Storage](../../tutorials/kubernetes-backup.md)