From c3be19c882f259174d73780c2a0ef5c94c70b55e Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 16:27:12 +0800 Subject: [PATCH 01/14] refactor: GreptimeDB Operator section --- .../deploy-greptimedb-operator.md | 58 +++++++++++++++ .../upgrade-greptimedb-operator.md | 74 +++++++++++++++++++ sidebars.ts | 9 ++- 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md create mode 100644 docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md new file mode 100644 index 000000000..f326b6dad --- /dev/null +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -0,0 +1,58 @@ +# Deploy GreptimeDB Operator + +## Overview +The GreptimeDB Kubernetes Operator simplifies deploying GreptimeDB on both private and public cloud infrastructures. This guide walks you through installing the latest stable version of the GreptimeDB Operator on a Kubernetes cluster. The Operator leverages a [Custom Resource Definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) to represent GreptimeDB as a Kubernetes [object](https://kubernetes.io/docs/concepts/overview/working-with-objects/). + + +## Prerequisites +- [Helm](https://helm.sh/docs/intro/install/) (Use the Version appropriate for your Kubernetes API version) + +## Install the GreptimeDB Operator using Helm Charts + +GreptimeDB provides a Helm-compatible repository for easy deployment. Follow these steps to install the Operator using Helm: + +### 1. Add the GreptimeDB Operator Repository +First, add the GreptimeDB Operator Helm repository: + +1. Add the GreptimeDB Operator Repo to Helm +```bash +helm repo add greptime https://greptimeteam.github.io/helm-charts/ +``` + +Validate the repository by searching for the Operator chart: +```bash +helm search repo greptimedb-operator +``` + +You should see output similar to this: +``` +NAME CHART VERSION APP VERSION DESCRIPTION +greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. +``` + +### 2. Install the Operator +To install the Operator, run the following `helm install` command. This command also creates a dedicated namespace `greptimedb-operator` for the installation. It's recommended to use a dedicated namespace for the Operator: +```bash +helm install \ + --create-namespace \ + greptimedb-operator greptime/greptimedb-operator \ + -n greptimedb-operator +``` + +### 3. Verify the Operator installation +After installation, check the contents of the `greptimedb-operator` namespace to confirm that all pods and services are running correctly: +```bash +kubectl get all -n greptimedb-operator +``` + +You should see output similar to this: +```bash +NAME READY STATUS RESTARTS AGE +pod/greptimedb-operator-8495fcb545-jpz2m 1/1 Running 0 17s + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/greptimedb-operator 1/1 1 1 17s + +NAME DESIRED CURRENT READY AGE +replicaset.apps/greptimedb-operator-8495fcb545 1 1 1 17s +``` \ No newline at end of file diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md new file mode 100644 index 000000000..519792d27 --- /dev/null +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -0,0 +1,74 @@ +# Upgrade GreptimeDB Operator +You can upgrade the GreptimeDB Operator at any time without impacting your managed GreptimeDB instances. This guide details the steps to upgrade an existing GreptimeDB Operator installation using Helm, specifically from version 0.2.1 to 0.2.3. + +### 1. Verify the existing Operator installation. + +First, verify the health and status of all Operator pods and services using: + +```bash +kubectl get all -n greptimedb-operator +``` + +If the Operator was installed in a custom namespace, replace `greptimedb-operator` with your specific namespace using `-n `. + +Next, view the installed Helm charts in the namespace: + +```bash +helm list -n greptimedb-operator +``` + +You should see output similar to this: +``` +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +greptimedb-operator greptimedb-operator 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 +``` + +### 2. Update the Operator Repository + +Update the GreptimeDB Operator Helm repository to fetch the latest charts: + +```bash +helm repo update greptimedb-operator +``` + +If you used a different alias when adding the repository, replace `greptimedb-operator` with that alias. You can review your Helm repositories with: + +```bash +helm repo list +``` + +Check the latest available chart version: + +```bash +helm search repo greptimedb-operator +``` + +You should see output similar to this: +```bash +NAME CHART VERSION APP VERSION DESCRIPTION +greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. +``` + +### 3. Run helm upgrade + +Use Helm to upgrade the GreptimeDB Operator to the latest version: +```bash +helm upgrade -n greptimedb-operator \ +operator greptime/greptimedb-operator +``` + +If the Operator is installed in a different namespace, specify it with the `-n` argument. Additionally, if you used a different installation name than operator, replace `operator` in the command. + +The command should return a successful upgrade with an incremented `REVISION` value. + +### 4. Validate the Operator upgrade + +To confirm the upgrade, run the same helm list command as before: +```bash +helm list -n greptimedb-operator +``` + +You should see output similar to this: +``` +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +greptimedb-operator greptimedb-operator 2 2024-08-30 08:18:14.115248532 +0000 UTC deployed greptimedb-operator-0.2.3 0.1.0-alpha.29``` \ No newline at end of file diff --git a/sidebars.ts b/sidebars.ts index 25f6b2bd6..ee78b5c5c 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -157,7 +157,14 @@ const sidebars: SidebarsConfig = { label: 'Deploy on Kubernetes', items: [ 'user-guide/operations/deploy-on-kubernetes/overview', - 'user-guide/operations/deploy-on-kubernetes/greptimedb-operator', + { + type: 'category', + label: 'Manage GreptimeDB Operator', + items: [ + 'user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator', + 'user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator', + ] + }, 'user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster', 'user-guide/operations/deploy-on-kubernetes/destroy-cluster', ], From cfa6eda3aad48031ce52a28123f5e98ff310f655 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 17:35:55 +0800 Subject: [PATCH 02/14] chore: apply suggestions from CR --- .../deploy-greptimedb-operator.md | 16 ++++++------- .../upgrade-greptimedb-operator.md | 23 ++++++++----------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md index f326b6dad..bc2569574 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -11,10 +11,8 @@ The GreptimeDB Kubernetes Operator simplifies deploying GreptimeDB on both priva GreptimeDB provides a Helm-compatible repository for easy deployment. Follow these steps to install the Operator using Helm: -### 1. Add the GreptimeDB Operator Repository +### Add the GreptimeDB Operator repository First, add the GreptimeDB Operator Helm repository: - -1. Add the GreptimeDB Operator Repo to Helm ```bash helm repo add greptime https://greptimeteam.github.io/helm-charts/ ``` @@ -30,16 +28,16 @@ NAME CHART VERSION APP VERSION DESCRIPTION greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. ``` -### 2. Install the Operator +### Install the Operator To install the Operator, run the following `helm install` command. This command also creates a dedicated namespace `greptimedb-operator` for the installation. It's recommended to use a dedicated namespace for the Operator: ```bash helm install \ + operator greptime/greptimedb-operator \ --create-namespace \ - greptimedb-operator greptime/greptimedb-operator \ -n greptimedb-operator ``` -### 3. Verify the Operator installation +### Verify the Operator installation After installation, check the contents of the `greptimedb-operator` namespace to confirm that all pods and services are running correctly: ```bash kubectl get all -n greptimedb-operator @@ -48,11 +46,11 @@ kubectl get all -n greptimedb-operator You should see output similar to this: ```bash NAME READY STATUS RESTARTS AGE -pod/greptimedb-operator-8495fcb545-jpz2m 1/1 Running 0 17s +pod/operator-8495fcb545-jpz2m 1/1 Running 0 17s NAME READY UP-TO-DATE AVAILABLE AGE -deployment.apps/greptimedb-operator 1/1 1 1 17s +deployment.apps/operator 1/1 1 1 17s NAME DESIRED CURRENT READY AGE -replicaset.apps/greptimedb-operator-8495fcb545 1 1 1 17s +replicaset.apps/operator-8495fcb545 1 1 1 17s ``` \ No newline at end of file diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index 519792d27..99bbc3b64 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -1,7 +1,7 @@ # Upgrade GreptimeDB Operator -You can upgrade the GreptimeDB Operator at any time without impacting your managed GreptimeDB instances. This guide details the steps to upgrade an existing GreptimeDB Operator installation using Helm, specifically from version 0.2.1 to 0.2.3. +You can upgrade the GreptimeDB Operator at any time without impacting your managed GreptimeDB instances. This guide details the steps to upgrade an existing GreptimeDB Operator installation using Helm, specifically from version 0.2.1 to the lastest version. -### 1. Verify the existing Operator installation. +### Verify the existing Operator installation. First, verify the health and status of all Operator pods and services using: @@ -20,10 +20,10 @@ helm list -n greptimedb-operator You should see output similar to this: ``` NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -greptimedb-operator greptimedb-operator 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 +operator greptimedb-operator 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 ``` -### 2. Update the Operator Repository +### Update the Operator Repository Update the GreptimeDB Operator Helm repository to fetch the latest charts: @@ -49,7 +49,7 @@ NAME CHART VERSION APP VERSION DESCRIPTION greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. ``` -### 3. Run helm upgrade +### Upgrade the Operator version Use Helm to upgrade the GreptimeDB Operator to the latest version: ```bash @@ -61,14 +61,9 @@ If the Operator is installed in a different namespace, specify it with the `-n` The command should return a successful upgrade with an incremented `REVISION` value. -### 4. Validate the Operator upgrade +### Verify the Operator upgrade -To confirm the upgrade, run the same helm list command as before: +To confirm the upgrade, run the following command: ```bash -helm list -n greptimedb-operator -``` - -You should see output similar to this: -``` -NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -greptimedb-operator greptimedb-operator 2 2024-08-30 08:18:14.115248532 +0000 UTC deployed greptimedb-operator-0.2.3 0.1.0-alpha.29``` \ No newline at end of file +kubectl get pod -l 'app.kubernetes.io/name=operator' -n greptimedb-operator -o json | jq '.items[0].spec.containers[0].image' +``` \ No newline at end of file From 0ddf90a356a3363da68b277f1dae22b1426fa0e3 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 17:41:57 +0800 Subject: [PATCH 03/14] chore: apply suggestions from CR --- .../upgrade-greptimedb-operator.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index 99bbc3b64..b2c366f28 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -23,7 +23,9 @@ NAME NAMESPACE REVISION UPDATED operator greptimedb-operator 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 ``` -### Update the Operator Repository +The Operator is currently installed with version `0.1.0-alpha.28` using the `greptimedb-operator-0.2.1` chart. + +### Update the Operator repository Update the GreptimeDB Operator Helm repository to fetch the latest charts: @@ -66,4 +68,9 @@ The command should return a successful upgrade with an incremented `REVISION` va To confirm the upgrade, run the following command: ```bash kubectl get pod -l 'app.kubernetes.io/name=operator' -n greptimedb-operator -o json | jq '.items[0].spec.containers[0].image' +``` + +You should see the following output, indicating that the Operator has been successfully upgraded to the latest version: +```bash +"docker.io/greptime/greptimedb-operator:v0.1.0-alpha.29" ``` \ No newline at end of file From 7e7f0bb2a51e5d5bdcdb347446a79a2e5dd3f93e Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 17:45:13 +0800 Subject: [PATCH 04/14] fix: fix typo --- .../manage-greptimedb-operator/upgrade-greptimedb-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index b2c366f28..e45995b0f 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -1,5 +1,5 @@ # Upgrade GreptimeDB Operator -You can upgrade the GreptimeDB Operator at any time without impacting your managed GreptimeDB instances. This guide details the steps to upgrade an existing GreptimeDB Operator installation using Helm, specifically from version 0.2.1 to the lastest version. +You can upgrade the GreptimeDB Operator at any time without impacting your managed GreptimeDB instances. This guide details the steps to upgrade an existing GreptimeDB Operator installation using Helm, specifically from version 0.2.1 to the latest version. ### Verify the existing Operator installation. From 210b8878a275f89f6081cdbb5046bafd1bc1e4ee Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 17:49:14 +0800 Subject: [PATCH 05/14] chore: add chart repo link --- .../manage-greptimedb-operator/deploy-greptimedb-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md index bc2569574..8d41b3bfe 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -9,7 +9,7 @@ The GreptimeDB Kubernetes Operator simplifies deploying GreptimeDB on both priva ## Install the GreptimeDB Operator using Helm Charts -GreptimeDB provides a Helm-compatible repository for easy deployment. Follow these steps to install the Operator using Helm: +GreptimeDB provides a [Helm-compatible repository](https://github.com/GreptimeTeam/helm-charts) for easy deployment. Follow these steps to install the Operator using Helm: ### Add the GreptimeDB Operator repository First, add the GreptimeDB Operator Helm repository: From 52d57b085cb45ec75701ff523e72cf551b418159 Mon Sep 17 00:00:00 2001 From: Yiran Date: Fri, 30 Aug 2024 18:06:21 +0800 Subject: [PATCH 06/14] Apply suggestions from code review --- .../manage-greptimedb-operator/upgrade-greptimedb-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index e45995b0f..267d84ba5 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -56,7 +56,7 @@ greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operato Use Helm to upgrade the GreptimeDB Operator to the latest version: ```bash helm upgrade -n greptimedb-operator \ -operator greptime/greptimedb-operator + operator greptime/greptimedb-operator ``` If the Operator is installed in a different namespace, specify it with the `-n` argument. Additionally, if you used a different installation name than operator, replace `operator` in the command. From 673fec6d02ae1ab4a6b6931e3147fc2b7c584c06 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 16:07:43 +0800 Subject: [PATCH 07/14] chore: apply suggestions from CR --- .../deploy-greptimedb-operator.md | 30 ++++++++++++------- .../upgrade-greptimedb-operator.md | 14 ++++----- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md index 8d41b3bfe..e64add62d 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -29,28 +29,36 @@ greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operato ``` ### Install the Operator -To install the Operator, run the following `helm install` command. This command also creates a dedicated namespace `greptimedb-operator` for the installation. It's recommended to use a dedicated namespace for the Operator: +To install the Operator, run the following `helm install` command. This command also creates a dedicated namespace `greptimedb-admin` for the installation. It's recommended to use a dedicated namespace for the Operator: ```bash helm install \ operator greptime/greptimedb-operator \ --create-namespace \ - -n greptimedb-operator + -n greptimedb-admin ``` -### Verify the Operator installation -After installation, check the contents of the `greptimedb-operator` namespace to confirm that all pods and services are running correctly: +### Verify the CRD installation +Check the contents of the `greptimedb-admin` namespace to confirm that all Custom Resource Definitions (CRDs) have been installed correctly: + ```bash -kubectl get all -n greptimedb-operator +kubectl get crds -n greptimedb-admin ``` You should see output similar to this: ```bash -NAME READY STATUS RESTARTS AGE -pod/operator-8495fcb545-jpz2m 1/1 Running 0 17s +NAME CREATED AT +greptimedbclusters.greptime.io 2024-09-09T07:54:07Z +greptimedbstandalones.greptime.io 2024-09-09T07:54:07Z +``` -NAME READY UP-TO-DATE AVAILABLE AGE -deployment.apps/operator 1/1 1 1 17s +### Verify the Operator installation +After installation, check the contents of the `greptimedb-admin` namespace to confirm that all pods are running correctly: +```bash +kubectl get pods -n greptimedb-admin +``` -NAME DESIRED CURRENT READY AGE -replicaset.apps/operator-8495fcb545 1 1 1 17s +You should see output similar to this: +```bash +NAME READY STATUS RESTARTS AGE +operator-greptimedb-operator-7d58cb8f7c-jz46g 1/1 Running 0 26s ``` \ No newline at end of file diff --git a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index 267d84ba5..667aee67d 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -3,24 +3,24 @@ You can upgrade the GreptimeDB Operator at any time without impacting your manag ### Verify the existing Operator installation. -First, verify the health and status of all Operator pods and services using: +First, verify the health and status of all Operator pods using: ```bash -kubectl get all -n greptimedb-operator +kubectl get pods -n greptimedb-admin ``` -If the Operator was installed in a custom namespace, replace `greptimedb-operator` with your specific namespace using `-n `. +If the Operator was installed in a custom namespace, replace `greptimedb-admin` with your specific namespace using `-n `. Next, view the installed Helm charts in the namespace: ```bash -helm list -n greptimedb-operator +helm list -n greptimedb-admin ``` You should see output similar to this: ``` NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -operator greptimedb-operator 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 +operator greptimedb-admin 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 ``` The Operator is currently installed with version `0.1.0-alpha.28` using the `greptimedb-operator-0.2.1` chart. @@ -55,7 +55,7 @@ greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operato Use Helm to upgrade the GreptimeDB Operator to the latest version: ```bash -helm upgrade -n greptimedb-operator \ +helm upgrade -n greptimedb-admin \ operator greptime/greptimedb-operator ``` @@ -67,7 +67,7 @@ The command should return a successful upgrade with an incremented `REVISION` va To confirm the upgrade, run the following command: ```bash -kubectl get pod -l 'app.kubernetes.io/name=operator' -n greptimedb-operator -o json | jq '.items[0].spec.containers[0].image' +kubectl get pod -l 'app.kubernetes.io/name=operator' -n greptimedb-admin -o json | jq '.items[0].spec.containers[0].image' ``` You should see the following output, indicating that the Operator has been successfully upgraded to the latest version: From ef9dff7a00acadaa3d460bc7a9108dce05ac56c1 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 16:37:11 +0800 Subject: [PATCH 08/14] chore: add zh version --- .../deploy-greptimedb-operator.md | 66 ++++++++++++++++ .../upgrade-greptimedb-operator.md | 76 +++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md new file mode 100644 index 000000000..5f030d828 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -0,0 +1,66 @@ +# 部署 GreptimeDB Operator + +## 概述 + +GreptimeDB Kubernetes Operator 简化了在私有和公共云基础设施上部署 GreptimeDB 的过程。本指南将引导你在 Kubernetes 集群上安装最新的稳定版本的 GreptimeDB Operator。该 Operator 利用 [自定义资源定义 (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) 将 GreptimeDB 表示为 Kubernetes [对象](https://kubernetes.io/docs/concepts/overview/working-with-objects/)。 + +## 先决条件 +- [Helm](https://helm.sh/docs/intro/install/) (请使用与你的 Kubernetes API 版本相匹配的版本) + +## 使用 Helm Charts 安装 GreptimeDB Operator + +GreptimeDB 提供了一个 [兼容 Helm 的仓库](https://github.com/GreptimeTeam/helm-charts),便于部署。按照以下步骤使用 Helm 安装 Operator: + +### 添加 GreptimeDB Operator 仓库 +首先,添加 GreptimeDB Operator 的 Helm 仓库: +```bash +helm repo add greptime https://greptimeteam.github.io/helm-charts/ +``` + +搜索 Operator chart 以验证仓库: +```bash +helm search repo greptimedb-operator +``` + +你应该看到类似如下的输出: +``` +NAME CHART VERSION APP VERSION DESCRIPTION +greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. +``` + +### 安装 Operator + +要安装 Operator,运行以下 `helm install` 命令。此命令还会为安装创建一个专用的命名空间 `greptimedb-admin`。推荐为 Operator 创建专用的命名空间: + +```bash +helm install \ + operator greptime/greptimedb-operator \ + --create-namespace \ + -n greptimedb-admin +``` + +### 验证 CRD 安装 +检查 `greptimedb-admin` 命名空间的内容,确认所有自定义资源定义 (CRD) 是否已正确安装: + +```bash +kubectl get crds -n greptimedb-admin +``` + +你应该看到类似如下的输出: +```bash +NAME CREATED AT +greptimedbclusters.greptime.io 2024-09-09T07:54:07Z +greptimedbstandalones.greptime.io 2024-09-09T07:54:07Z +``` + +### 验证 Operator 安装 +安装后,检查 `greptimedb-admin` 命名空间的内容,确认所有 Pod 是否正常运行: +```bash +kubectl get pods -n greptimedb-admin +``` + +你应该看到类似如下的输出: +```bash +NAME READY STATUS RESTARTS AGE +operator-greptimedb-operator-7d58cb8f7c-jz46g 1/1 Running 0 26s +``` \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md new file mode 100644 index 000000000..7a37fd9a6 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -0,0 +1,76 @@ +# 升级 GreptimeDB Operator +你可以随时升级 GreptimeDB Operator,而不会影响已管理的 GreptimeDB 实例。本指南详细介绍了如何使用 Helm 将现有的 GreptimeDB Operator 从版本 0.2.1 升级到最新版本。 + +### 验证现有的 Operator 安装 + +首先,使用以下命令验证所有 Operator Pod 的健康状态和状态: + +```bash +kubectl get pods -n greptimedb-admin +``` + +如果 Operator 安装在自定义命名空间中,请使用 `-n ` 将 `greptimedb-admin` 替换为你的特定命名空间。 + +接下来,查看命名空间中的已安装 Helm charts: + +```bash +helm list -n greptimedb-admin +``` + +你应该看到类似如下的输出: +``` +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +operator greptimedb-admin 1 2024-08-30 08:04:53.388756424 +0000 UTC deployed greptimedb-operator-0.2.1 0.1.0-alpha.28 +``` + +Operator chart 版本为 `greptimedb-operator-0.2.1` 的,APP 版本为 `0.1.0-alpha.28`。 + +### 更新 Operator 仓库 + +更新 GreptimeDB Operator 的 Helm 仓库以获取最新的 charts: + +```bash +helm repo update greptimedb-operator +``` + +如果在添加仓库时使用了不同的别名,请将 `greptimedb-operator` 替换为相应的别名。你可以通过以下命令查看你的 Helm 仓库: + +```bash +helm repo list +``` + +检查最新的可用 chart 版本: + +```bash +helm search repo greptimedb-operator +``` + +你应该看到类似如下的输出: +```bash +NAME CHART VERSION APP VERSION DESCRIPTION +greptime/greptimedb-operator 0.2.3 0.1.0-alpha.29 The greptimedb-operator Helm chart for Kubernetes. +``` + +### 升级 Operator 版本 + +使用 Helm 将 GreptimeDB Operator 升级到最新版本: +```bash +helm upgrade -n greptimedb-admin \ + operator greptime/greptimedb-operator +``` + +如果 Operator 安装在不同的命名空间中,请使用 `-n` 参数指定它。另外,如果使用了不同的安装名称,请在命令中将 `operator` 替换为实际的安装名称。 + +该命令应该会返回一个成功的升级结果,并显示递增的 REVISION 值。 + +### 验证 Operator 升级 + +要确认升级成功,运行以下命令: +```bash +kubectl get pod -l 'app.kubernetes.io/name=operator' -n greptimedb-admin -o json | jq '.items[0].spec.containers[0].image' +``` + +你应该看到如下输出,表明 Operator 已成功升级到最新版本: +```bash +"docker.io/greptime/greptimedb-operator:v0.1.0-alpha.29" +``` \ No newline at end of file From dab5b1fc0f05b9c9dfe0193accaf398917a08ae0 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 16:40:26 +0800 Subject: [PATCH 09/14] fix: broken links --- .../deploy-on-kubernetes/deploy-greptimedb-cluster.md | 2 +- .../deploy-on-kubernetes/deploy-greptimedb-cluster.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/docs/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md index 4e6cca93d..b79b1882c 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -1,7 +1,7 @@ # Deploy GreptimeDB Cluster Before the deployment, -make sure you have already installed [GreptimeDB Operator](greptimedb-operator.md) on your Kubernetes cluster. +make sure you have already installed [GreptimeDB Operator](./manage-greptimedb-operator/deploy-greptimedb-operator.md) on your Kubernetes cluster. ## Using Helm for deployment diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md index 40e3c4cf4..173fd6136 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -1,6 +1,6 @@ # 部署 GreptimeDB 集群 -在部署之前,请确保你已经在 Kubernetes 集群上安装了 [GreptimeDB Operator](greptimedb-operator.md)。 +在部署之前,请确保你已经在 Kubernetes 集群上安装了 [GreptimeDB Operator](./manage-greptimedb-operator/deploy-greptimedb-operator.md)。 ## 使用 Helm 进行部署 From 3fdede547d7b92c191ddf869fef330744165e25a Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 16:49:47 +0800 Subject: [PATCH 10/14] docs: add optional part for zh doc --- .../deploy-greptimedb-operator.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md index 5f030d828..f8ce63f44 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md @@ -39,6 +39,24 @@ helm install \ -n greptimedb-admin ``` +### (可选)使用本地 Helm charts 进行安装 + +如您遇到网络问题,先拉取 chart 到本地: + +```shell +wget https://downloads.greptime.cn/releases/charts/greptimedb-operator/latest/greptimedb-operator-latest.tgz +tar -zxvf greptimedb-operator-latest.tgz +``` + +然后安装 GreptimeDB Operator: + +```shell +helm install greptimedb-operator greptimedb-operator \ + --set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \ + --create-namespace \ + -n greptimedb-admin +``` + ### 验证 CRD 安装 检查 `greptimedb-admin` 命名空间的内容,确认所有自定义资源定义 (CRD) 是否已正确安装: From 4f6d80cc0c87db787185595538814166a28536cb Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 17:04:45 +0800 Subject: [PATCH 11/14] chore: add zh label translation --- i18n/zh/docusaurus-plugin-content-docs/current.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current.json b/i18n/zh/docusaurus-plugin-content-docs/current.json index 931a993d7..d6e779212 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh/docusaurus-plugin-content-docs/current.json @@ -51,6 +51,10 @@ "message": "部署到 Kubernetes", "description": "The label for category Deploy on Kubernetes in sidebar docs" }, + "sidebar.docs.category.Manage GreptimeDB Operator": { + "message": "管理 GreptimeDB Operator", + "description": "The label for category Deploy on Kubernetes in sidebar docs" + }, "sidebar.docs.category.Disaster Recovery": { "message": "灾难恢复", "description": "The label for category Disaster Recovery in sidebar docs" From 0273b47a5e48b9048307e14b9b69b78a9b444826 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 17:54:31 +0800 Subject: [PATCH 12/14] chore: remove greptimedb-operator.md --- .../greptimedb-operator.md | 38 ------------------ .../greptimedb-operator.md | 39 ------------------- 2 files changed, 77 deletions(-) delete mode 100644 docs/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md delete mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md diff --git a/docs/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md b/docs/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md deleted file mode 100644 index 3c0956972..000000000 --- a/docs/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md +++ /dev/null @@ -1,38 +0,0 @@ -# GreptimeDB Operator - -## Install GreptimeDB Operator - -By utilizing the [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/), -[GreptimeDB Operator](https://github.com/GreptimeTeam/greptimedb-operator) can effectively manage GreptimeDB clusters on [Kubernetes](https://kubernetes.io/). -This operator abstracts the model of maintaining a highly available GreptimeDB cluster. - -You can use Helm to install GreptimeDB Operator. - -```shell -helm upgrade \ - --install greptimedb-operator greptime/greptimedb-operator \ - --create-namespace \ - -n greptimedb-admin -``` - -## Install and upgrade CRDs - -Helm cannot upgrade custom resource definitions in the `/crds` folder [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). - -We support installing and upgrading CRDs automatically using the chart. You can disable this behavior by using `--set crds.install=false` when installing the chart: - -```shell -helm upgrade \ - --install greptimedb-operator greptime/greptimedb-operator \ - --create-namespace \ - -n greptimedb-admin \ - --set crds.install=false -``` - -When you uninstall the GreptimeDB Operator, it will not delete the CRDs by default. - - - -## Next steps - -- [Deploy GreptimeDB Cluster](deploy-greptimedb-cluster.md): This section provides instructions on how to deploy etcd cluster and GreptimeDB cluster on Kubernetes. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md deleted file mode 100644 index 69955713b..000000000 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md +++ /dev/null @@ -1,39 +0,0 @@ -# GreptimeDB Operator - -## 安装 GreptimeDB Operator - -通过利用 [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/), -[GreptimeDB Operator](https://github.com/GreptimeTeam/greptimedb-operator) 可以有效管理 [Kubernetes](https://kubernetes.io/) 上的 GreptimeDB 集群。 -这个 operator 可以抽象出维护高可用 GreptimeDB 集群的模式。 - -你可以使用 Helm 来安装 GreptimeDB Operator。 - -```shell -helm upgrade \ - --install oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-operator greptimedb-operator \ - --set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \ - --create-namespace \ - -n greptimedb-admin -``` - -## CRD 的安装和升级 - -Helm 被[设计](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations)为无法自动更新 `/crds`,为了方便部署,GreptimeDB 支持使用 Chart 自动安装和升级 CRD。你可以在安装 Chart 时使用 `--set crds.install=false` 来禁用这个行为: - -```shell -helm upgrade \ - --install oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-operator greptimedb-operator \ - --set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \ - --set crds.install=false \ - --create-namespace \ - -n greptimedb-admin \ - --set crds.install=false -``` - -当你卸载 GreptimeDB Operator 时,默认不会删除 CRD。 - - - -## Next steps - -- [部署GreptimeDB集群](deploy-greptimedb-cluster.md):本节介绍了如何在 Kubernetes 上部署 etcd 集群和 GreptimeDB 集群。 From bf756fae231d9f5ac108be19d459878bbf7daa10 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 17:55:51 +0800 Subject: [PATCH 13/14] docs: add optional part for zh doc --- .../upgrade-greptimedb-operator.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md index 7a37fd9a6..06a8d90ec 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md @@ -63,6 +63,23 @@ helm upgrade -n greptimedb-admin \ 该命令应该会返回一个成功的升级结果,并显示递增的 REVISION 值。 +### (可选)使用本地 Helm charts 进行升级 +如您遇到网络问题,先拉取 chart 到本地: + +```shell +wget https://downloads.greptime.cn/releases/charts/greptimedb-operator/latest/greptimedb-operator-latest.tgz +tar -zxvf greptimedb-operator-latest.tgz +``` + +然后安装 GreptimeDB Operator: + +```shell +helm upgrade greptimedb-operator greptimedb-operator \ + --set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \ + --create-namespace \ + -n greptimedb-admin +``` + ### 验证 Operator 升级 要确认升级成功,运行以下命令: From 55aa7602dfebc00cda1bbdc388b18268a0267788 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 9 Sep 2024 19:47:58 +0800 Subject: [PATCH 14/14] chore: update dead links --- docs/user-guide/operations/deploy-on-kubernetes/overview.md | 2 +- .../user-guide/operations/deploy-on-kubernetes/overview.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/operations/deploy-on-kubernetes/overview.md b/docs/user-guide/operations/deploy-on-kubernetes/overview.md index 50b2437eb..e507b8d73 100644 --- a/docs/user-guide/operations/deploy-on-kubernetes/overview.md +++ b/docs/user-guide/operations/deploy-on-kubernetes/overview.md @@ -37,6 +37,6 @@ The deployment on Kubernetes involves the following components: To deploy GreptimeDB on Kubernetes, follow these steps: -- [GreptimeDB Operator](greptimedb-operator.md): This section guides you on installing the GreptimeDB Operator. +- [GreptimeDB Operator](./manage-greptimedb-operator/deploy-greptimedb-operator.md): This section guides you on installing the GreptimeDB Operator. - [Deploy GreptimeDB Cluster](deploy-greptimedb-cluster.md): This section provides instructions on how to deploy etcd cluster and GreptimeDB cluster on Kubernetes. - [Destroy Cluster](destroy-cluster.md): This section describes how to uninstall the GreptimeDB Operator and the GreptimeDB cluster. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/overview.md index f7a0b9c8d..9a6599b81 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/operations/deploy-on-kubernetes/overview.md @@ -47,6 +47,6 @@ helm upgrade --install mycluster \ 请按照以下步骤继续操作: -- [GreptimeDB Operator](greptimedb-operator.md):本章节指导你安装 GreptimeDB Operator。 +- [GreptimeDB Operator](./manage-greptimedb-operator/deploy-greptimedb-operator.md):本章节指导你安装 GreptimeDB Operator。 - [部署GreptimeDB集群](deploy-greptimedb-cluster.md):本节介绍了如何在 Kubernetes 上部署 etcd 集群和 GreptimeDB 集群。 - [销毁集群](destroy-cluster.md):本节介绍如何卸载 GreptimeDB Operator 和 GreptimeDB 集群。