Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix docs bugs in installing kbcli, bakcup repo docs #8870

Merged
merged 9 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
52 changes: 0 additions & 52 deletions docs/user_docs/handle-an-exception/full-disk-lock.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/user_docs/installation/install-kbcli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ You can install kbcli with `curl` or `brew`.
```bash
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s x.y.z
```

You can view all versions of kbcli, including alpha and beta releases, on the [kbcli releases list](https://github.com/apecloud/kbcli/releases).

To get stable releases, use this command:

```bash
curl -s "https://api.github.com/repos/apecloud/kbcli/releases?per_page=100&page=1" | jq -r '.[] | select(.prerelease == false) | .tag_name' | sort -V -r
```
Expand Down Expand Up @@ -148,6 +150,12 @@ Install kbcli using the `curl` command.
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash
```

To install a specified version of kbcli, use `-s` after the command and describe the version you want to install.

```bash
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s x.y.z
```

2. Run `kbcli version` to check the version of kbcli and ensure that it is successfully installed.

:::note
Expand All @@ -159,6 +167,10 @@ Install kbcli using the `curl` command.
</TabItem>
</Tabs>

## Upgrade kbcli

To upgrade kbcli, [uninstall the current kbcli](./uninstall-kubeblocks-and-kbcli.md#uninstall-kbcli) and install the latest version.

## (Optional) Enable auto-completion for kbcli

`kbcli` supports command line auto-completion.
Expand Down
152 changes: 83 additions & 69 deletions docs/user_docs/maintenance/backup-and-restore/backup/backup-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,74 +88,6 @@ Generally, it is recommended to use the "Tool" method as it does not require ins

However, as backup and restore tasks require running in the namespace of the database cluster, using the "Tool" approach automatically synchronizes the necessary credentials for accessing the remote storage as secret resources in those namespaces. These credentials are used by the data transfer tool. If you have concerns about security risks associated with synchronizing secrets in a multi-tenant environment, you can choose to use the "Mount" method.

### Automatic BackupRepo configuration

You can specify the BackupRepo information in a YAML configuration file when installing KubeBlocks, and KubeBlocks will create the BackupRepo and automatically install the necessary CSI Driver based on the provided configuration.

1. Prepare the configuration file.

Taking AWS S3 as an example, the configuration file `backuprepo.yaml` is:

```yaml
backupRepo:
create: true
storageProvider: s3
config:
region: cn-northwest-1
bucket: test-kb-backup
secrets:
accessKeyId: <ACCESS KEY>
secretAccessKey: <SECRET KEY>
```

* `region`: specifies the region where S3 is located.
* `bucket`: specifies the bucket name of S3.
* `accessKeyId`: specifies the Access Key of AWS.
* `secretAccessKey`: specifies the Secret Key of AWS.
* `storageProvider`:specifies the object storage provider, which is S3 in this case.

:::note

* For KubeBlocks v0.8.0, the available `storageProvider` options are `s3`, `cos`, `gcs-s3comp`, `obs`, `oss`, `minio`, `pvc`, `ftp`, and `nfs`.
* For different `storageProvider`, the configuration may differ. `config` and `secrets` in the above example are applied to S3.
* Execute the command `kubectl get storageproviders.dataprotection.kubeblocks.io` to view the supported `storageProvider` options.

:::

2. Specify the configuration file when installing KubeBlocks.

<Tabs>

<TabItem value="kubectl" label="kubectl" default>

```bash
kubectl create -f backuprepo.yaml
```

Use the command below to check the BackupRepo after installation.

```bash
kubectl get backuprepo
```

</TabItem>

<TabItem value="kbcli" label="kbcli">

```bash
kbcli kubeblocks install -f backuprepo.yaml
```

Use the command below to check the BackupRepo after installation.

```bash
kbcli backuprepo list
```

</TabItem>

</Tabs>

### Manual BackupRepo configuration

If you do not configure the BackupRepo information when installing KubeBlocks, you can manually configure it by the following instructions.
Expand Down Expand Up @@ -560,4 +492,86 @@ If you do not configure the BackupRepo information when installing KubeBlocks, y

</TabItem>

</Tabs>
</Tabs>

:::note

If the BackupRepo status shows Failed or remains in PreChecking for a long time, run `kubectl describe backuprepo my-repo` or `kbcli backuprepo describe my-repo` to check the `status.conditions` for details.

To troubleshoot:

* Verify whether configuration parameters, such as `endpoint`, `accessKeyId`, and `secretAccessKey`, are correctly specified.
* For self-hosted object storage (e.g., Ceph Object Storage), try using `minio` as StorageProvider. The default `s3` StorageProvider uses a virtual hosting URL style, which some self-hosted storage may not support.
* If you see an `InvalidLocationConstraint` error, leave the `region` parameter empty and try again.
* If the status remains in the `PreChecking` state, check your network connection. Ensure the storage service is accessible from within the Kubernetes cluster. You can test this by running a Pod and connecting to the storage service using the corresponding client.
* KubeBlocks uses [rclone](https://rclone.org/) internally for data transfer. Check whether rclone can successfully access the storage service.

:::

### Automatic BackupRepo configuration

You can specify the BackupRepo information in a YAML configuration file when installing KubeBlocks, and KubeBlocks will create the BackupRepo and automatically install the necessary CSI Driver based on the provided configuration.

1. Prepare the configuration file.

Taking AWS S3 as an example, the configuration file `backuprepo.yaml` is:

```yaml
backupRepo:
create: true
storageProvider: s3
config:
region: cn-northwest-1
bucket: test-kb-backup
secrets:
accessKeyId: <ACCESS KEY>
secretAccessKey: <SECRET KEY>
```

* `region`: specifies the region where S3 is located.
* `bucket`: specifies the bucket name of S3.
* `accessKeyId`: specifies the Access Key of AWS.
* `secretAccessKey`: specifies the Secret Key of AWS.
* `storageProvider`:specifies the object storage provider, which is S3 in this case.

:::note

* For KubeBlocks v0.8.0, the available `storageProvider` options are `s3`, `cos`, `gcs-s3comp`, `obs`, `oss`, `minio`, `pvc`, `ftp`, and `nfs`.
* For different `storageProvider`, the configuration may differ. `config` and `secrets` in the above example are applied to S3.
* Execute the command `kubectl get storageproviders.dataprotection.kubeblocks.io` to view the supported `storageProvider` options.

:::

2. Specify the configuration file when installing KubeBlocks.

<Tabs>

<TabItem value="kubectl" label="kubectl" default>

```bash
kubectl create -f backuprepo.yaml
```

Use the command below to check the BackupRepo after installation.

```bash
kubectl get backuprepo
```

</TabItem>

<TabItem value="kbcli" label="kbcli">

```bash
kbcli kubeblocks install -f backuprepo.yaml
```

Use the command below to check the BackupRepo after installation.

```bash
kbcli backuprepo list
```

</TabItem>

</Tabs>
49 changes: 0 additions & 49 deletions i18n/zh-cn/user-docs/handle-an-exception/full-disk-lock.md

This file was deleted.

10 changes: 10 additions & 0 deletions i18n/zh-cn/user-docs/installation/install-kbcli.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ kbcli 目前支持 macOS、Windows 和 Linux 系统。
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash
```

如果想安装 kbcli 的指定版本,在上述命令后面加上 `-s` 和你想安装的版本号。

```bash
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s x.y.z
```

2. 执行 `kbcli version` 命令,检查 `kbcli` 版本并确保已成功安装。

:::note
Expand All @@ -161,6 +167,10 @@ kbcli 目前支持 macOS、Windows 和 Linux 系统。
</TabItem>
</Tabs>

## 升级 kbcli

升级 kbcli 仅需[卸载当前版本](./uninstall-kubeblocks-and-kbcli.md#卸载-kbcli),并安装新版本。

## (可选) 启用 kbcli 的自动补全功能

`kbcli` 支持命令行自动补全。
Expand Down
Loading
Loading