From 5246d8299f75587742adfff3329aa56d851feaa2 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 30 Aug 2024 16:27:12 +0800 Subject: [PATCH] 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 9217d2ae4..6a35740bb 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -151,7 +151,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', ],