Skip to content

Commit

Permalink
Expand on documentation for ignoring snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
renormalize committed Oct 22, 2024
1 parent 4f9279e commit c3c906a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/usage/immutable_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ Making objects immutable for extended periods can increase storage costs since t

## Ignoring Snapshots From Restoration

There might be certain cases where operators would like etcd-backup-restore to ignore particular snapshots in the object store from restoration.
There might be certain cases where operators would like `etcd-backup-restore` to ignore particular snapshots present in the object store during restoration of etcd's data-dir.
When snapshots were mutable, operators could simply delete these snapshots, and the restoration that follows this would not include them.
Once immutability is turned on, however, it would not be possible to do this.

Various cloud providers provide functionality to add custom annotations/tags to objects to add additional information to objects. These additional annotations/tags are orthogonal to the object's metadata, and therefore do not affect the object itself. This feature is thus available for objects which are immutable as well.

We leverage this feature to signal to etcd-backup-restore to not consider certain snapshots during restoration.
The annotation/tag that is to be added to a snapshot for this is `x-etcd-snapshot-exclude=true`, `ExcludeSnapshotMetadataKey` as defined in `pkg/types`.
The annotation/tag that is to be added to a snapshot for this is `x-etcd-snapshot-exclude=true`.

You can add these tags through for the following providers like so:

Expand All @@ -51,10 +51,18 @@ You can add these tags through for the following providers like so:
gcloud storage objects update gs://bucket/your-snapshot --custom-metadata=x-etcd-snapshot-exclude=true
```

or:

Use the Google Cloud Console to add custom metadata to the object in the `Custom metadata` section of the object.

- **Azure Blob Storage**: as specified in the [docs](https://learn.microsoft.com/en-us/cli/azure/storage/blob/tag?view=azure-cli-latest#az-storage-blob-tag-set). (ABS calls this tags).

```sh
az storage blob tag set --container-name your-container --name your-snapshot --tags "x-etcd-snapshot-exclude"="true"
```

Once these annotations/tags are added, etcd-backup-restore will ignore those snapshots from restoration.
or

Use the Azure Portal to add the tag in the `Blob index tags` section of the blob.

Once these annotations/tags are added, etcd-backup-restore will ignore those snapshots during restoration.

0 comments on commit c3c906a

Please sign in to comment.