Skip to content

Commit

Permalink
refactor: GreptimeDB Operator section
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Aug 30, 2024
1 parent a4a34e3 commit 5246d82
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
@@ -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 <NAMESPACE>`.

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```
9 changes: 8 additions & 1 deletion sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down

0 comments on commit 5246d82

Please sign in to comment.