diff --git a/README-CN.md b/README-CN.md index 3f4964b3..00e7759d 100644 --- a/README-CN.md +++ b/README-CN.md @@ -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 是否部署成功: diff --git a/README.md b/README.md index c28bfc9c..8bbc2640 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/index.md b/docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/index.md index 36a5af3a..55f41db3 100644 --- a/docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/index.md +++ b/docsite/i18n/zh-Hans/docusaurus-plugin-content-pages/index.md @@ -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 是否部署成功: diff --git a/docsite/src/pages/index.md b/docsite/src/pages/index.md index 6b039070..8889bfc4 100644 --- a/docsite/src/pages/index.md +++ b/docsite/src/pages/index.md @@ -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: diff --git a/scripts/install-okctl.sh b/scripts/install-okctl.sh index 89e8894d..d9185878 100644 --- a/scripts/install-okctl.sh +++ b/scripts/install-okctl.sh @@ -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 @@ -56,6 +57,10 @@ while [[ $# -gt 0 ]]; do usage exit 0 ;; + -p|--proxy) + USE_PROXY=true + shift + ;; *) echo "Unknown option: $1" usage @@ -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