Skip to content

Commit

Permalink
docs: update kubectl command
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle-0808 committed Jan 24, 2025
1 parent de7211f commit 7297ec1
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,40 @@ If you do not configure the BackupRepo information when installing KubeBlocks, y
</TabItem>
<TabItem value="S3-compatible" label="S3-compatible">
```bash
# Create a secret to save the access key for the S3 compatible storage
kubectl create secret generic s3-comp-credential-for-backuprepo \
-n kb-system \
--from-literal=accessKeyId=<ACCESS KEY> \
--from-literal=secretAccessKey=<SECRET KEY>
# Create the BackupRepo resource
kubectl apply -f - <<-'EOF'
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: BackupRepo
metadata:
name: my-repo
annotations:
dataprotection.kubeblocks.io/is-default-repo: "true"
spec:
storageProviderRef: s3-compatible
accessMethod: Tool
pvReclaimPolicy: Retain
volumeCapacity: 100Gi
config:
bucket: test-kb-backup
endpoint: <endpoint>
forcePathStyle: true
credential:
name: s3-comp-credential-for-backuprepo
namespace: kb-system
EOF
```
</TabItem>
</Tabs>
3. View the BackupRepo and its status. If the status is `Ready`, the BackupRepo is ready.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,40 @@ BackupRepo 是备份数据的存储仓库,支持配置 OSS(阿里云对象

</TabItem>

<TabItem value="S3-compatible" label="S3-compatible">

```bash
# Create a secret to save the access key for the S3 compatible storage
kubectl create secret generic s3-comp-credential-for-backuprepo \
-n kb-system \
--from-literal=accessKeyId=<ACCESS KEY> \
--from-literal=secretAccessKey=<SECRET KEY>
# Create the BackupRepo resource
kubectl apply -f - <<-'EOF'
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: BackupRepo
metadata:
name: my-repo
annotations:
dataprotection.kubeblocks.io/is-default-repo: "true"
spec:
storageProviderRef: s3-compatible
accessMethod: Tool
pvReclaimPolicy: Retain
volumeCapacity: 100Gi
config:
bucket: test-kb-backup
endpoint: <endpoint>
forcePathStyle: true
credential:
name: s3-comp-credential-for-backuprepo
namespace: kb-system
EOF
```
</TabItem>
</Tabs>
以上命令创建了一个名为 `my-repo` 的默认备份仓库。
Expand Down

0 comments on commit 7297ec1

Please sign in to comment.