> For the complete documentation index, see [llms.txt](https://docs.storware.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storware.eu/protecting-virtual-machines/protecting-containers/kubernetes.md).

# Kubernetes

## Overview

Storware Backup & Recovery supports Kubernetes backups using Velero and a sidecar pod in the backup process.

Backup of the following objects is supported:

* Deployment
* Stateful set
* Daemon set
* Virtual machine

## Supported features

**Supported backup strategies:** Helper pod

<table data-full-width="false"><thead><tr><th width="274"></th><th width="240">Helper pod</th></tr></thead><tbody><tr><td>Minimal version</td><td>1.30</td></tr><tr><td>The last snapshot is kept on the system for incremental backups</td><td>Yes</td></tr><tr><td>Access to OS required</td><td>No</td></tr><tr><td>Proxy VM required</td><td>No</td></tr></tbody></table>

<table data-header-hidden data-search="false"><thead><tr><th width="273"></th><th width="239">Helper pod</th></tr></thead><tbody><tr><td>Full backup</td><td>Supported</td></tr><tr><td>Incremental backup</td><td>Supported *</td></tr><tr><td>Synthetic backups</td><td>Supported *</td></tr><tr><td>File-level restore</td><td>Supported *</td></tr><tr><td>Volume exclusion</td><td>Supported</td></tr><tr><td>Quiesced snapshots</td><td>Supported **</td></tr><tr><td>Snapshots management</td><td>Not supported</td></tr><tr><td>Pre/post command execution</td><td>Supported ***</td></tr><tr><td>Access to VM disk backup over iSCSI</td><td>Supported *</td></tr><tr><td>Name-based policy assignment</td><td>Supported</td></tr><tr><td>Tag-based policy assignment</td><td>Supported</td></tr><tr><td>Power-on after restore</td><td>Supported</td></tr><tr><td>StatefulSet</td><td>Supported</td></tr></tbody></table>

*\* When using Ceph RBD or Block Volume as a Persistent Volume*

*\*\* Deployment pause*

*\*\*\* Only the 'post' command*

## Network requirements

**Connection URL:** `https://API_HOST:6443`

| Source            | Destination                   | Ports           | Description                         |
| ----------------- | ----------------------------- | --------------- | ----------------------------------- |
| Node              | Kubernetes API host           | 6443/tcp        | API access                          |
| Kubernetes Worker | Node                          | 9000/tcp        | S3 connection for metadata transfer |
| Node              | Plugin helper pod (via route) | 30000-32767/tcp | Ddata transfer                      |

## Requirements:

* Installed Velero
* Service Account with Cluster Admin role

## **Adding Kubernetes** <a href="#adding-a-standalone-hyper-v-host" id="adding-a-standalone-hyper-v-host"></a>

1. Log in to the Storware Backup & Recovery WebUI.
2. Navigate to: **Virtual Environments → Virtualization Providers.**
3. Click the **Create** button to open the **Add new Virtualization Provider**.
4. Select **Kubernetes** from the drop-down menu.
5. In the **General** tab:
   1. Specify **Node configuration** for the nodes communicating with the Kubernetes API
   2. **URL** - Kubernetes API URL, e.g. `https://10.201.32.40:6443`
   3. Depending on the authorization method you choose, provide a username and password or a token for the service account.
6. Save and **run the first inventory synchronization.**

{% hint style="info" %}
In Kubernetes, user authentication via basic authentication (username and password) is no longer recommended. This mechanism was deprecated starting in version 1.19 and was completely removed in version 1.24.
{% endhint %}

## Backup Process

The backup process consists of three main stages:

### 1. Creating Data Snapshots

Before the backup starts, Storware Backup & Recovery checks whether the underlying storage supports snapshots.

If snapshots are available:

* A snapshot of the application data is created.
* The backup is performed from the snapshot to ensure data consistency.

If snapshots are not available:

* File-based volumes can still be backed up directly.
* Some volume types, such as block volumes, require snapshots to perform a backup.

### 2. Backing Up Application Configuration

In addition to application data, Storware Backup & Recovery also backs up configuration and metadata, including data volumes, persistent volume claims, config maps, secrets, and services.

### 3. Backing Up Volume Data

Storware Backup & Recovery then exports the data stored on application volumes.

Depending on the storage technology in use, the most appropriate backup method is selected automatically.

#### Ceph Volume Backup

When an application uses Ceph-based storage, Storware Backup & Recovery utilizes native Ceph capabilities for data export.

Supported backup types:

* **Full Backup** – contains the complete volume content.
* **Incremental Backup** – contains only the data changed since the last backup.

To use this backup method:

1. Follow the [Ceph RBD setup](https://docs.storware.eu/protecting-storage-providers/storage-providers/ceph-rbd)
2. Make sure to have this setup done **for all nodes** that will need access to the Ceph monitors.
3. Make sure that volumes have appeared in the **Storage -> Instances** tab to confirm connectivity between the node and Ceph monitors
4. **For each Ceph RBD storage,** assign your Ceph storage provider and the appropriate Ceph storage pool in **Virtual Environments -> Virtualization Providers -> your Kubernetes manager details -> Storage -> Storage Class -> Ceph settings**

#### Block Volume Backup

For other block-based storage volumes, Storware Backup & Recovery:

1. Creates temporary copies from snapshots.
2. Reads the volume data.
3. Exports the data into backup files.
4. Removes temporary resources after completion.

Supported backup types:

* **Full Backup** – contains the complete volume content.
* **Incremental Backup** – contains only the data changed since the last backup.

#### Filesystem Volume Backup

For filesystem-based volumes, the Storware Backup & Recovery:

1. Uses snapshots when available.
2. Reads the volume contents.
3. Creates an archive containing all files.
4. Stores the archive as part of the backup.

Filesystem volumes support **full backups only**.
