Skip to content

Commit

Permalink
docs(cli): added a new method to install ob-operator by okctl (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored Dec 24, 2024
1 parent 27714d6 commit edf3f1e
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 1 deletion.
26 changes: 26 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,32 @@ terraform init
terraform apply
```

#### 使用命令行工具 (okctl)

您还可以使用命令行工具 okctl 来部署 ob-operator,okctl 是可以用来部署 ob-operator 和管理 OceanBase 集群的方便的工具。

你可以通过 releases 页面下载 CLI 工具,或者通过以下命令下载:

```shell
# 使用代理
curl -sL https://gh.wewell.org/https://github.com/oceanbase/ob-operator/blob/master/scripts/install-okctl.sh | bash -s -- --proxy

# 不使用代理
curl -sL https://raw.githubusercontent.com/oceanbase/ob-operator/master/scripts/install-okctl.sh | bash
```

下载完成之后,可以通过以下命令来部署 ob-operator,

```shell
./okctl install
```

另外,我们推荐将 CLI 工具添加到 PATH 环境变量中,

```shell
mv ./okctl /usr/local/bin
```

#### 验证部署结果

安装完成之后,可以使用以下命令验证 ob-operator 是否部署成功:
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ terraform init
terraform apply
```

#### Using CLI tool (okctl)

You can also use the CLI tool, okctl, to deploy ob-operator, it is a convenient way to deploy ob-operator and manage OceanBase clusters.

You can download okctl from the releases page or through the following command:

```shell
curl -sL https://raw.githubusercontent.com/oceanbase/ob-operator/master/scripts/install-okctl.sh | bash
```

After downloading okctl, you can deploy ob-operator by executing the following command:

```shell
./okctl install
```

By the way, we recommend you to add okctl to your PATH environment variable like this:

```shell
mv ./okctl /usr/local/bin
```

#### Verify deployment

After deployment/installation is complete, you can use the following command to verify if ob-operator is deployed successfully:
Expand Down
26 changes: 26 additions & 0 deletions docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,32 @@ terraform init
terraform apply
```

#### 使用命令行工具 (okctl)

您还可以使用命令行工具 okctl 来部署 ob-operator,okctl 是可以用来部署 ob-operator 和管理 OceanBase 集群的方便的工具。

你可以通过 releases 页面下载 CLI 工具,或者通过以下命令下载:

```shell
# 使用代理
curl -sL https://gh.wewell.org/https://github.com/oceanbase/ob-operator/blob/master/scripts/install-okctl.sh | bash -s -- --proxy

# 不使用代理
curl -sL https://raw.githubusercontent.com/oceanbase/ob-operator/master/scripts/install-okctl.sh | bash
```

下载完成之后,可以通过以下命令来部署 ob-operator,

```shell
./okctl install
```

另外,我们推荐将 CLI 工具添加到 PATH 环境变量中,

```shell
mv ./okctl /usr/local/bin
```

#### 验证部署结果

安装完成之后,可以使用以下命令验证 ob-operator 是否部署成功:
Expand Down
22 changes: 22 additions & 0 deletions docsite/src/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ terraform init
terraform apply
```

#### Using CLI tool (okctl)

You can also use the CLI tool, okctl, to deploy ob-operator, it is a convenient way to deploy ob-operator and manage OceanBase clusters.

You can download okctl from the releases page or through the following command:

```shell
curl -sL https://raw.githubusercontent.com/oceanbase/ob-operator/master/scripts/install-okctl.sh | bash
```

After downloading okctl, you can deploy ob-operator by executing the following command:

```shell
./okctl install
```

By the way, we recommend you to add okctl to your PATH environment variable like this:

```shell
mv ./okctl /usr/local/bin
```

#### Verify deployment

After deployment/installation is complete, you can use the following command to verify if ob-operator is deployed successfully:
Expand Down
10 changes: 9 additions & 1 deletion scripts/install-okctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ VERSION="0.1.0"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
BINARY_NAME="okctl"
USE_PROXY=false

# Map architecture names
case ${ARCH} in
Expand Down Expand Up @@ -56,6 +57,10 @@ while [[ $# -gt 0 ]]; do
usage
exit 0
;;
-p|--proxy)
USE_PROXY=true
shift
;;
*)
echo "Unknown option: $1"
usage
Expand Down Expand Up @@ -86,9 +91,12 @@ check_requirements() {
install_binary() {
local version=$1
local BINARY_NAME="okctl"
if [ $USE_PROXY = true ]; then
GITHUB_HOST="https://gh.wewell.org/https://github.com"
fi
local download_url="${GITHUB_HOST}/${GITHUB_REPO}/releases/download/cli-${version}/${BINARY_NAME}_${version}_${OS}_${ARCH}.tar.gz"

echo "Downloading ${BINARY_NAME} ${version}..."
echo "Downloading ${BINARY_NAME} ${version} from ${download_url} ..."
if ! curl -L -o "${BINARY_NAME}_${version}.tar.gz" "${download_url}"; then
echo "Error: Failed to download ${download_url}"
exit 1
Expand Down

0 comments on commit edf3f1e

Please sign in to comment.