Skip to content

Commit 96dd628

Browse files
Update backup-restore docs
1 parent 43cf029 commit 96dd628

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

vcluster/manage/backup-restore.mdx

+44-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Snapshot & Restore
44
sidebar_position: 3
55
---
66

7-
There is multiple ways how to backup and restore a virtual cluster. vCluster provides a way to create a vCluster snapshot and restore the snapshot via its own CLI.
7+
There are multiple ways how to backup and restore a virtual cluster. vCluster provides a way to create a vCluster snapshot and restore the snapshot via its own CLI.
88

99
:::warning
1010
If you are using an external database like MySQL or Postgresql that is **not** running inside the same namespace as vCluster, you need to create a separate backup for the datastore as well. Please refer to the appropriate docs for doing that.
@@ -13,27 +13,27 @@ If you are using an external database like MySQL or Postgresql that is **not** r
1313
## Using vCluster CLI
1414

1515
:::info
16-
This method requires vCluster version v0.24.0 or higher
16+
Only supported in vCluster v0.24.0+
1717
:::
1818

19-
The easiest and recommended way to backup the etcd datastore of a vCluster is through the CLI. When using the CLI, vCluster creates a new pod to save the snapshot to the specified location. vCluster automatically determines the configured backing store. The following information is snapshotted:
19+
The recommended way to back up the etcd datastore of a vCluster is through the CLI. When using the CLI, vCluster creates a new pod to save the snapshot to the specified location. vCluster automatically determines the configured backing store. The following information is snapshotted:
2020
* Backing store data (e.g. etcd, sqlite)
2121
* vCluster helm release information
2222
* vCluster configuration (e.g. vcluster.yaml)
2323

2424
:::info
25-
Currently the vCluster CLI backup method does not support backing up persistent volumes. If you require that please take a look at the velero backup method below.
25+
Currently the vCluster CLI backup method does not support backing up persistent volumes. If you are using persistent volumes in your virtual cluster, use the velero backup method below.
2626
:::
2727

2828
### Snapshot URL
2929

3030
vCluster uses a snapshot URL to save the snapshot to a specific location. The snapshot URL is a string that contains the following information:
3131

32-
* The protocol to use (e.g. `oci`, `s3`, `container`)
33-
* The location to save the snapshot (e.g. `oci://ghcr.io/my-user/my-repo:my-tag`, `s3://my-s3-bucket/my-snapshot-key`, `container:///data/my-snapshot.tar.gz`)
34-
* Optional flags to pass to the snapshot location (e.g. `skip-client-credentials=true`)
32+
* Protocol to use to take the snapshot (e.g. `oci`, `s3`, `container`)
33+
* Location to save the snapshot (e.g. `oci://ghcr.io/my-user/my-repo:my-tag`, `s3://my-s3-bucket/my-snapshot-key`, `container:///data/my-snapshot.tar.gz`)
34+
* Optional parameters to pass to the snapshot location (e.g. `skip-client-credentials=true`)
3535

36-
The following protocols are supported:
36+
### Supported Protocols
3737

3838
* `oci` - OCI image registry (e.g. docker hub or ghcr.io)
3939
* `s3` - s3 compatible bucket (e.g. AWS S3 or minio)
@@ -46,32 +46,53 @@ vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag"
4646

4747
#### oci
4848

49-
The following flags are supported for the `oci` protocol:
49+
Snapshots can be saved to an OCI image registry.
50+
51+
Example:
52+
53+
```bash
54+
echo $PASSWORD_ACCESS_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
55+
vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag"
56+
```
57+
58+
Alternative Options: Pass credentials as URL parameters.
59+
5060
* `username` - The username to use to authenticate with the OCI image registry
5161
* `password` - The base64 encoded password to use to authenticate with the OCI image registry
5262
* `skip-client-credentials` - Do not use the local credentials to authenticate with the OCI image registry
5363

54-
Example how to create a snapshot to an OCI image registry:
64+
Example with alternative options:
65+
5566
```bash
56-
vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag"
67+
export OCI_USERNAME=my-username
68+
export OCI_PASSWORD=$(echo -n "my-password" | base64)
69+
vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag?username=$OCI_USERNAME&password=$OCI_PASSWORD&skip-client-credentials=true"
5770
```
5871

5972
#### s3
6073

61-
The following flags are supported for the `s3` protocol:
74+
Snapshots can be saved to a s3 compatible bucket.
75+
76+
Example:
77+
78+
```bash
79+
# 1. Login to AWS CLI to set your environment variables
80+
# 2. Take your snapshot
81+
vcluster snapshot my-vcluster "s3://my-s3-bucket/my-bucket-key"
82+
```
83+
84+
Alternative Options: Pass credentials as URL parameters.
85+
6286
* `access-key-id` - The base64 encoded access key id to use to authenticate with the s3 compatible bucket
6387
* `secret-access-key` - The base64 encoded secret access key to use to authenticate with the s3 compatible bucket
6488
* `session-token` - The base64 encoded session token to use to authenticate with the s3 compatible bucket
6589
* `region` - The region of the s3 compatible bucket
6690
* `profile` - The profile to use to authenticate with the s3 compatible bucket
6791
* `skip-client-credentials` - Do not use the local credentials to authenticate with the s3 compatible bucket
6892

69-
Example how to create a snapshot to an s3 compatible bucket:
70-
```bash
71-
vcluster snapshot my-vcluster "s3://my-s3-bucket/my-bucket-key"
72-
93+
Example with alternative options:
7394

74-
# with custom credetials
95+
```bash
7596
export ACCESS_KEY_ID=$(cat my-access-key-id.txt | base64)
7697
export SECRET_ACCESS_KEY=$(cat my-secret-access-key.txt | base64)
7798
export SESSION_TOKEN=$(cat my-session-token.txt | base64)
@@ -80,8 +101,12 @@ vcluster snapshot my-vcluster "s3://my-s3-bucket/my-bucket-key"
80101

81102
#### container
82103

83-
Example how to create a snapshot to the vCluster container:
104+
Snapshots can be saved to a local file inside the vCluster container or another PVC.
105+
106+
Example:
107+
84108
```bash
109+
# Saved to the vCluster container
85110
vcluster snapshot my-vcluster "container:///data/my-snapshot.tar.gz"
86111
```
87112

@@ -95,7 +120,7 @@ vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag"
95120
# create an OCI snapshot and mount an external image pull secret
96121
vcluster snapshot my-vcluster "oci://ghcr.io/my-user/my-repo:my-tag?skip-client-credentials=true" --pod-image-pull-secret=my-image-pull-secret
97122

98-
# create an s3 snapshot
123+
# create an s3 snapshot
99124
vcluster snapshot my-vcluster "s3://my-s3-bucket/my-snapshot-key"
100125

101126
# create a snapshot to local vCluster pvc (if using embedded storage)

0 commit comments

Comments
 (0)