-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: GreptimeDB Operator section (#1160)
Co-authored-by: Yiran <cuiyiran3@gmail.com>
- Loading branch information
Showing
12 changed files
with
333 additions
and
82 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
docs/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
docs/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
...s/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# 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](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: | ||
```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. | ||
``` | ||
|
||
### Install 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-admin | ||
``` | ||
|
||
### 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 crds -n greptimedb-admin | ||
``` | ||
|
||
You should see output similar to this: | ||
```bash | ||
NAME CREATED AT | ||
greptimedbclusters.greptime.io 2024-09-09T07:54:07Z | ||
greptimedbstandalones.greptime.io 2024-09-09T07:54:07Z | ||
``` | ||
|
||
### 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 | ||
``` | ||
|
||
You should see output similar to this: | ||
```bash | ||
NAME READY STATUS RESTARTS AGE | ||
operator-greptimedb-operator-7d58cb8f7c-jz46g 1/1 Running 0 26s | ||
``` |
76 changes: 76 additions & 0 deletions
76
.../deploy-on-kubernetes/manage-greptimedb-operator/upgrade-greptimedb-operator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# 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 latest version. | ||
|
||
### Verify the existing Operator installation. | ||
|
||
First, verify the health and status of all Operator pods using: | ||
|
||
```bash | ||
kubectl get pods -n greptimedb-admin | ||
``` | ||
|
||
If the Operator was installed in a custom namespace, replace `greptimedb-admin` with your specific namespace using `-n <NAMESPACE>`. | ||
|
||
Next, view the installed Helm charts in the namespace: | ||
|
||
```bash | ||
helm list -n greptimedb-admin | ||
``` | ||
|
||
You should see output similar to this: | ||
``` | ||
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 | ||
``` | ||
|
||
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: | ||
|
||
```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. | ||
``` | ||
|
||
### Upgrade the Operator version | ||
|
||
Use Helm to upgrade the GreptimeDB Operator to the latest version: | ||
```bash | ||
helm upgrade -n greptimedb-admin \ | ||
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. | ||
|
||
### Verify the Operator upgrade | ||
|
||
To confirm the upgrade, run the following command: | ||
```bash | ||
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: | ||
```bash | ||
"docker.io/greptime/greptimedb-operator:v0.1.0-alpha.29" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...current/user-guide/operations/deploy-on-kubernetes/deploy-greptimedb-cluster.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
...-docs/current/user-guide/operations/deploy-on-kubernetes/greptimedb-operator.md
This file was deleted.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
...s/deploy-on-kubernetes/manage-greptimedb-operator/deploy-greptimedb-operator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# 部署 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 | ||
``` | ||
|
||
### (可选)使用本地 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) 是否已正确安装: | ||
|
||
```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 | ||
``` |
Oops, something went wrong.