Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/enterprise/snapshots-config-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ After you configure a storage destination, you can create a backup. See [Creatin
## Additional Resources

* [Restoring Full Backups](snapshots-restoring-full)
* [Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
* [Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-configuring-hostpath.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This topic describes how to install Velero and configure a host path as your sto

Complete the following items before you perform this task:

* Review the limitations and considerations. See [Limitations and Considerations](snapshots-understanding#limitations-and-considerations) in _About Backup and Restore_.
* Review the limitations and considerations. See [Limitations and Considerations](/vendor/snapshots-overview#limitations-and-considerations) in _About Backup and Restore_.
* Install the velero CLI. See [Installing the Velero CLI](snapshots-velero-cli-installing).

## Install Velero and Configure Host Path Storage in Online Environments
Expand Down Expand Up @@ -118,4 +118,4 @@ To install Velero and configure host path storage for existing clusters:

## Additional Resources

* [Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
* [Troubleshooting Snapshots](/enterprise/snapshots-troubleshooting-backup-restore)
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-configuring-nfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Configuring an NFS server as a snapshots storage destination has the following r

Complete the following items before you perform this task:

* Review the limitations and considerations. See [Limitations and Considerations](snapshots-understanding#limitations-and-considerations) in _About Backup and Restore_.
* Review the limitations and considerations. See [Limitations and Considerations](/vendor/snapshots-overview#limitations-and-considerations) in _About Backup and Restore_.
* Install the velero CLI. See [Installing the Velero CLI](snapshots-velero-cli-installing).

## Install Velero and Configure NFS Storage in Online Environments
Expand Down Expand Up @@ -121,4 +121,4 @@ To install Velero and configure NFS storage for existing clusters:

## Additional Resources

* [Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
* [Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
2 changes: 1 addition & 1 deletion docs/enterprise/snapshots-creating.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ To schedule automatic backups in the Admin Console:
The retention policy applies to all backups, including both automatically- and manually-created backups. Changing the retention policy affects only backups created after the time of the change.
## Additional Resources

[Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
[Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-restoring-full.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following limitations apply to restoring from backups using snapshots:
* <InstallMethod/>
* <CliRestores/>

For a full list of limitations and considerations related to the snapshots feature, see [Limitations and Considerations](snapshots-understanding#limitations-and-considerations) in _About Backup and Restore_.
For a full list of limitations and considerations related to the snapshots feature, see [Limitations and Considerations](/vendor/snapshots-overview#limitations-and-considerations) in _About Backup and Restore_.

## Restore From a Full Backup Using the CLI {#full-cli}

Expand Down Expand Up @@ -158,4 +158,4 @@ To restore an application from a partial backup:

## Additional Resources

[Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
[Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-storage-destinations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To configure host path or NFS as a storage destination, see [Configuring a Host

Complete the following items before you install Velero and configure a storage destination:

* Review the limitations and considerations. See [Limitations and Considerations](snapshots-understanding#limitations-and-considerations) in _About Backup and Restore_.
* Review the limitations and considerations. See [Limitations and Considerations](/vendor/snapshots-overview#limitations-and-considerations) in _About Backup and Restore_.
* Install the velero CLI. See [Installing the Velero CLI](snapshots-velero-cli-installing).

## Configure AWS Storage for Online Environments
Expand Down Expand Up @@ -188,4 +188,4 @@ If no Velero installation is detected, instructions are displayed to install Vel

## Additional Resources

* [Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
* [Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-troubleshooting-backup-restore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NodeAgentMemLimit from "../partials/snapshots/_node-agent-mem-limit.mdx"

# Troubleshooting Backup and Restore
# Troubleshooting Snapshots
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Updated various topic titles so that it's easier to see at a glance which ones apply to snapshots and which ones apply to EC DR


When a snapshot fails, a support bundle will be collected and stored automatically. Because this is a point-in-time collection of all logs and system state at the time of the failed snapshot, this is a good place to view the logs.

Expand Down Expand Up @@ -160,7 +160,7 @@ There are file changes between Restic's initial scan of the volume and during th

To resolve this issue, do one of the following:

* Use [Snapshot Hooks](https://docs.replicated.com/vendor/snapshots-hooks) to export data to an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume and include that in the backup instead of the primary PVC volume.
* Use [hooks](/vendor/snapshots-hooks) to export data to an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume and include that in the backup instead of the primary PVC volume. See [Configuring Backup and Restore Hooks for Snapshots](/vendor/snapshots-hooks).
* Freeze the file system to ensure all pending disk I/O operations have completed prior to taking a snapshot. For more information, see [Hook Example with fsfreeze](https://velero.io/docs/main/backup-hooks/#hook-example-with-fsfreeze) in the Velero documentation.


Expand Down
4 changes: 2 additions & 2 deletions docs/enterprise/snapshots-velero-cli-installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To install the Velero CLI in an online cluster:
- (Embedded kURL cluster) Run an SSH command to access and authenticate to your cluster node.
- (Existing cluster) Open a terminal in the environment that you manage the cluster from, which can be a local machine that has kubectl installed.

1. Check for the latest supported release of the Velero CLI for **Linux AMD64** in the Velero GitHub repo at https://github.com/vmware-tanzu/velero/releases. Although earlier versions of Velero are supported, Replicated recommends using the latest supported version. For more information about supported versions, see [Velero Version Compatibility](snapshots-understanding#velero-version-compatibility) in _About Backup and Restore_.
1. Check for the latest supported release of the Velero CLI for **Linux AMD64** in the Velero GitHub repo at https://github.com/vmware-tanzu/velero/releases. Although earlier versions of Velero are supported, Replicated recommends using the latest supported version. For more information about supported versions, see [Velero Version Compatibility](/vendor/snapshots-overview#velero-version-compatibility).

Note the version number for the next step.

Expand Down Expand Up @@ -55,7 +55,7 @@ To install the Velero CLI in an online cluster:

To install the Velero CLI in an air gapped cluster:

1. From a computer with internet access, check for the latest supported release of the Velero CLI for **Linux AMD64** in the Velero GitHub repo at https://github.com/vmware-tanzu/velero/releases. Although earlier versions of Velero are supported, Replicated recommends using the latest [supported version](/enterprise/snapshots-understanding#velero-version-compatibility).
1. From a computer with internet access, check for the latest supported release of the Velero CLI for **Linux AMD64** in the Velero GitHub repo at https://github.com/vmware-tanzu/velero/releases. Although earlier versions of Velero are supported, Replicated recommends using the latest supported version. See [Velero Version Compatibility](/vendor/snapshots-overview#velero-version-compatibility).

Note the version number for the next step.

Expand Down
2 changes: 1 addition & 1 deletion docs/enterprise/snapshots-velero-installing-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Velero sets default limits for the velero Pod and the node-agent (restic) Pod du

## Additional Resources

* [Troubleshooting Backup and Restore](snapshots-troubleshooting-backup-restore)
* [Troubleshooting Snapshots](snapshots-troubleshooting-backup-restore)
2 changes: 1 addition & 1 deletion docs/partials/snapshots/_limitation-cli-restores.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Only full backups can be restored using the KOTS CLI. To restore an application from a partial backup, use the Admin Console. See [Restore the Application Only Using the Admin Console](snapshots-restoring-full#admin-console).
Only full backups can be restored using the KOTS CLI. To restore an application from a partial backup, use the Admin Console. See [Restore the Application Only Using the Admin Console](/enterprise/snapshots-restoring-full#admin-console).
72 changes: 31 additions & 41 deletions docs/reference/custom-resource-backup.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
# Velero Backup Custom Resource
# Velero Backup Resource for Snapshots

The Backup custom resource enables the Replicated snapshots backup and restore feature. The backend of this feature uses the Velero open source project to back up Kubernetes manifests and persistent volumes.
This topic provides information about the supported fields in the Velero Backup resource for the Replicated KOTS snapshots feature.

Add a Backup custom resource (`kind: Backup`, `apiVersion: velero.io/v1`) to your release and configure it as needed. A Backup custom resource is required for each application that you deploy.
## Overview

You must add annotations for each volume that you want to back up. For more information about configuring backups, see [Configuring Backups](/vendor/snapshots-configuring-backups).

The Backup custom resource also supports optional resource installations so that the feature can be dynamically enabled based on a license field or a config option. For more information, see [Conditionally Including or Excluding Resources](/vendor/packaging-include-resources).

Full backups are recommended because they give the flexibility of restoring full data, the application only, or the KOTS Admin Console only. For an example of a full backup and a list of the supported fields, see [Example](#example) and [Fields](#fields).

Partial backups (application only) are supported but not recommended. For partial backups, you can use all of the fields that Velero supports. For information about the supported fields for partial backups, see [Backups](https://velero.io/docs/v1.10/api-types/backup/) in the Velero documentation.
The Velero Backup custom resource enables the KOTS snapshots backup and restore feature. The backend of this feature uses the Velero open source project to back up Kubernetes manifests and persistent volumes.

## Example

The following example shows the supported fields for a full backup.

The `annotations` field shows that `pvc-volume` is the only volume included in the backup.
The following shows an example of the Velero Backup resource:

```yaml
apiVersion: velero.io/v1
kind: Backup
metadata:
name: backup
annotations:
# `pvc-volume` will be the only volume included in the backup
backup.velero.io/backup-volumes: pvc-volume
spec:
includedNamespaces:
- '*'
excludedNamespaces:
- some-namespace
orLabelSelectors:
- matchLabels:
app: my-app
orderedResources:
pods: mysql/mysql-cluster-replica-0,mysql/mysql-cluster-replica-1
persistentvolumes: pvc-12345,pvc-67890
Expand Down Expand Up @@ -64,14 +54,16 @@ spec:
post:
```

## Fields
## Supported Fields for Full Backups with Snapshots {#fields}

For partial backups with the snapshots feature, you can use all of the fields that Velero supports. See [Backups](https://velero.io/docs/v1.10/api-types/backup/) in the Velero documentation.

The following Velero fields are supported for full backups, as shown in the previous example:
However, not all fields are supported for full backups. The table below lists the fields that are supported for full backups with snapshots:

<table>
<tr>
<th width="30%">Field Name</th>
<th width="70%">Description</th>
<th width="50%">Field Name</th>
<th width="50%">Description</th>
</tr>
<tr>
<td><code>includedNamespaces</code></td>
Expand All @@ -81,10 +73,6 @@ The following Velero fields are supported for full backups, as shown in the prev
<td><code>excludedNamespaces</code></td>
<td>(Optional) Specifies an array of namespaces to exclude from the backup.</td>
</tr>
<tr>
<td><code>orLabelSelectors</code></td>
<td>(Optional) A list of metav1.LabelSelector to filter with when adding individual objects to the backup. If multiple are provided, they will be joined by the OR operator.</td>
</tr>
<tr>
<td><code>orderedResources</code></td>
<td>(Optional) Specifies the order of the resources to collect during the backup process. This is a map that uses a key as the plural resource. Each resource name has the format NAMESPACE/OBJECTNAME. The object names are a comma delimited list. For cluster resources, use OBJECTNAME only.</td>
Expand All @@ -98,74 +86,76 @@ The following Velero fields are supported for full backups, as shown in the prev
<td>(Optional) Specifies the actions to perform at different times during a backup. The only supported hook is executing a command in a container in a pod (uses the pod exec API). Supports <code>pre</code> and <code>post</code> hooks.</td>
</tr>
<tr>
<td><code>resources</code></td>
<td><code>hooks.resources</code></td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ updated the table per Ethan's feedback that it was hard to see how the given fields are nested

<td>(Optional) Specifies an array of hooks that are applied to specific resources.</td>
</tr>
<tr>
<td><code>name</code></td>
<td><code>hooks.resources.name</code></td>
<td>Specifies the name of the hook. This value displays in the backup log.</td>
</tr>
<tr>
<td><code>includedNamespaces</code></td>
<td><code>hooks.resources.includedNamespaces</code></td>
<td>(Optional) Specifies an array of namespaces that this hook applies to. If unspecified, the hook is applied to all namespaces.</td>
</tr>
<tr>
<td><code>excludedNamespaces</code></td>
<td><code>hooks.resources.excludedNamespaces</code></td>
<td>(Optional) Specifies an array of namespaces to which this hook does not apply.</td>
</tr>
<tr>
<td><code>includedResources</code></td>
<td><code>hooks.resources.includedResources</code></td>
<td>Specifies an array of pod resources to which this hook applies.</td>
</tr>
<tr>
<td><code>excludedResources</code></td>
<td><code>hooks.resources.excludedResources</code></td>
<td>(Optional) Specifies an array of resources to which this hook does not apply.</td>
</tr>
<tr>
<td><code>labelSelector</code></td>
<td><code>hooks.resources.labelSelector</code></td>
<td>(Optional) Specifies that this hook only applies to objects that match this label selector.</td>
</tr>
<tr>
<td><code>pre</code></td>
<td><code>hooks.resources.pre</code></td>
<td>Specifies an array of <code>exec</code> hooks to run before executing custom actions.</td>
</tr>
<tr>
<td><code>post</code></td>
<td><code>hooks.resources.post</code></td>
<td>Specifies an array of <code>exec</code> hooks to run after executing custom actions. Supports the same arrays and fields as <code>pre</code> hooks.</td>
</tr>
<tr>
<td><code>exec</code></td>
<td><code>hooks.resources.[post/pre].exec</code></td>
<td>Specifies the type of the hook. <code>exec</code> is the only supported type.</td>
</tr>
<tr>
<td><code>container</code></td>
<td><code>hooks.resources.[post/pre].exec.container</code></td>
<td>(Optional) Specifies the name of the container where the specified command will be executed. If unspecified, the first container in the pod is used.</td>
</tr>
<tr>
<td><code>command</code></td>
<td><code>hooks.resources.[post/pre].exec.command</code></td>
<td>Specifies the command to execute. The format is an array.</td>
</tr>
<tr>
<td><code>onError</code></td>
<td><code>hooks.resources.[post/pre].exec.onError</code></td>
<td>(Optional) Specifies how to handle an error that might occur when executing the command. <b>Valid values:</b> <code>Fail</code> and <code>Continue</code> <b>Default:</b> <code>Fail</code></td>
</tr>
<tr>
<td><code>timeout</code></td>
<td><code>hooks.resources.[post/pre].exec.timeout</code></td>
<td>(Optional) Specifies how many seconds to wait for the command to finish executing before the action times out. <b>Default:</b> <code>30s</code></td>
</tr>
</table>

## Limitations {#limitations}

- The following top-level Velero fields, or children of `spec`, are not supported in full backups. Therefore, these fields are not shown in the preceding example specification. See [Example](#example).
- The following top-level Velero fields, or children of `spec`, are not supported in full backups:

- `snapshotVolumes`
- `volumeSnapshotLocations`
- `labelSelector`
- `includedResources`
- `excludedResources`

Note that some of these fields are supported for hook arrays, as described in the previous field definition table. See [Fields](#fields).
:::note
Some of these fields are supported for hook arrays, as described in the previous field definition table. See [Supported Fields for Full Backups with Snapshots](#fields) above.
:::

- All resources are included in the backup by default. However, resources can be excluded by adding `velero.io/exclude-from-backup=true` to the manifest files that you want to exclude. For more information, see [Configuring Backups](/vendor/snapshots-configuring-backups).
- All resources are included in the backup by default. However, resources can be excluded by adding `velero.io/exclude-from-backup=true` to the manifest files that you want to exclude. For more information, see [Configuring Snapshots](/vendor/snapshots-configuring-backups).

Loading