Skip to content

Commit

Permalink
docs: add the instruction for upgrading CRDs and install greptimedb-o…
Browse files Browse the repository at this point in the history
…perator and etcd cluster in different namespaces (#127)
  • Loading branch information
zyy17 authored Apr 28, 2024
1 parent 8fda1d8 commit 33b9dc4
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 72 deletions.
70 changes: 45 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is the repository that contains [Greptime](https://greptime.com/) Helm char

## Getting Started

### Add chart repository
### Add Chart Repository

You can add the chart repository with the following commands:

Expand All @@ -27,49 +27,66 @@ helm search repo greptime

### Install the GreptimeDB Cluster

If you want to deploy the GreptimeDB cluster, you can use the following command(use the `default` namespace):
If you want to deploy the GreptimeDB cluster, you can use the following commands:

1. **Deploy etcd cluster**

We recommend using the Bitnami etcd [chart](https://github.com/bitnami/charts/blob/main/bitnami/etcd/README.md) to deploy the etcd cluster:

```console
helm upgrade --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
helm upgrade \
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=3 \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
-n default
--create-namespace \
-n etcd-cluster
```

2. **Deploy GreptimeDB operator**

The greptimedb-operator will install in the `greptimedb-admin` namespace:

```console
helm upgrade --install greptimedb-operator greptime/greptimedb-operator -n default
helm upgrade \
--install \
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin
```

3. **Deploy GreptimeDB cluster**

- **Default Installation**
Install the GreptimeDB cluster in the `default` namespace:

- **Default installation**

The default installation will use the local storage:

The default installation will use the local storage:

```console
helm upgrade --install mycluster greptime/greptimedb-cluster -n default
```
```console
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
greptime/greptimedb-cluster \
-n default
```

- **Use AWS S3 as backend storage**
- **Use AWS S3 as backend storage**

Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage:
```console
helm upgrade --install mycluster greptime/greptimedb-cluster \
--set objectStorage.s3.bucket="your-bucket" \
--set objectStorage.s3.region="region-of-bucket" \
--set objectStorage.s3.root="root-directory-of-data" \
--set objectStorage.credentials.accessKeyId="your-access-key-id" \
--set objectStorage.credentials.secretAccessKey="your-secret-access-key" \
-n default
```
Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage:

```console
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
--set objectStorage.s3.bucket="your-bucket" \
--set objectStorage.s3.region="region-of-bucket" \
--set objectStorage.s3.root="root-directory-of-data" \
--set objectStorage.credentials.accessKeyId="your-access-key-id" \
--set objectStorage.credentials.secretAccessKey="your-secret-access-key" \
greptime/greptimedb-cluster \
-n default
```

4. **Use `kubectl port-forward` to access the GreptimeDB cluster**

Expand Down Expand Up @@ -97,20 +114,23 @@ For example:
helm upgrade --install mycluster greptime/greptimedb --values ./values.yaml
```

To upgrade the CRDs, you can follow [the guide](charts/greptimedb-operator/README.md) of greptimedb-operator.

### Uninstallation

If you want to terminate the GreptimeDB cluster, you can use the following command:

```console
helm uninstall mycluster -n default
helm uninstall etcd -n default
helm uninstall greptimedb-operator -n default
helm uninstall etcd -n etcd-cluster
helm uninstall greptimedb-operator -n greptimedb-admin
```

The CRDs of GreptimeDB are not deleted [by default](https://helm.sh/docs/topics/charts/#limitations-on-crds). You can delete them by the following command:

```console
kubectl delete crds greptimedbclusters.greptime.io
kubectl delete crds greptimedbstandalones.greptime.io
```

## List of Charts
Expand Down
4 changes: 2 additions & 2 deletions charts/greptimedb-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: greptimedb-cluster
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes.
type: application
version: 0.1.26
version: 0.1.27
appVersion: 0.7.2
home: https://github.com/GreptimeTeam/greptimedb
sources:
Expand Down
27 changes: 18 additions & 9 deletions charts/greptimedb-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# greptimedb-cluster

A Helm chart for deploying GreptimeDB cluster in Kubernetes
A Helm chart for deploying GreptimeDB cluster in Kubernetes.

![Version: 0.1.26](https://img.shields.io/badge/Version-0.1.26-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.2](https://img.shields.io/badge/AppVersion-0.7.2-informational?style=flat-square)
![Version: 0.1.27](https://img.shields.io/badge/Version-0.1.27-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.2](https://img.shields.io/badge/AppVersion-0.7.2-informational?style=flat-square)

## Source Code

Expand All @@ -17,32 +17,41 @@ A Helm chart for deploying GreptimeDB cluster in Kubernetes
2. Install the etcd cluster:

```console
helm upgrade --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=3 \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
-n default
helm upgrade \
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=3 \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
--create-namespace \
-n etcd-cluster
```

### Default installation

The default installation will use the local storage:

```console
helm upgrade --install mycluster greptime/greptimedb-cluster -n default
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
greptime/greptimedb-cluster \
-n default
```

### Use AWS S3 as backend storage

Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage:

```console
helm upgrade --install mycluster greptime/greptimedb-cluster \
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
--set objectStorage.s3.bucket="your-bucket" \
--set objectStorage.s3.region="region-of-bucket" \
--set objectStorage.s3.root="root-directory-of-data" \
--set objectStorage.credentials.accessKeyId="your-access-key-id" \
--set objectStorage.credentials.secretAccessKey="your-secret-access-key" \
greptime/greptimedb-cluster \
-n default
```

Expand Down
24 changes: 16 additions & 8 deletions charts/greptimedb-cluster/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,41 @@
2. Install the etcd cluster:

```console
helm upgrade --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=3 \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
-n default
helm upgrade \
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=3 \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
--create-namespace \
-n etcd-cluster
```


### Default installation

The default installation will use the local storage:

```console
helm upgrade --install mycluster greptime/greptimedb-cluster -n default
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
greptime/greptimedb-cluster \
-n default
```

### Use AWS S3 as backend storage

Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage:

```console
helm upgrade --install mycluster greptime/greptimedb-cluster \
helm upgrade \
--install mycluster \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
--set objectStorage.s3.bucket="your-bucket" \
--set objectStorage.s3.region="region-of-bucket" \
--set objectStorage.s3.root="root-directory-of-data" \
--set objectStorage.credentials.accessKeyId="your-access-key-id" \
--set objectStorage.credentials.secretAccessKey="your-secret-access-key" \
greptime/greptimedb-cluster \
-n default
```

Expand Down
4 changes: 2 additions & 2 deletions charts/greptimedb-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
kubeVersion: ">=1.18.0-0"
description: The greptimedb-operator Helm chart for Kubernetes
description: The greptimedb-operator Helm chart for Kubernetes.
name: greptimedb-operator
appVersion: 0.1.0-alpha.24
version: 0.1.14
version: 0.1.15
type: application
home: https://github.com/GreptimeTeam/greptimedb-operator
sources:
Expand Down
51 changes: 37 additions & 14 deletions charts/greptimedb-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
# greptimedb-operator

The greptimedb-operator Helm chart for Kubernetes
The greptimedb-operator Helm chart for Kubernetes.

![Version: 0.1.14](https://img.shields.io/badge/Version-0.1.14-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-alpha.24](https://img.shields.io/badge/AppVersion-0.1.0--alpha.24-informational?style=flat-square)
![Version: 0.1.15](https://img.shields.io/badge/Version-0.1.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-alpha.24](https://img.shields.io/badge/AppVersion-0.1.0--alpha.24-informational?style=flat-square)

## Source Code

- https://github.com/GreptimeTeam/greptimedb-operator

## How to install
## How to Install

### Add Chart Repository

```console
# Add charts repo.
helm repo add greptime https://greptimeteam.github.io/helm-charts/

# Update charts repo.
helm repo update
```

### Install the GreptimeDB Operator

Install greptimedb-operator in the `greptimedb-admin` namespace:

```console
helm upgrade \
--install \
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin
```

# Search charts repo.
helm search repo greptime -l --devel
If you want to specify the chart version, you can use `--version`:

# Deploy greptimedb-operator in default namespace.
helm upgrade --install greptimedb-operator greptime/greptimedb-operator -n default
```console
helm upgrade \
--install \
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin \
--version <chart-version>
```

# Specifiy the chart version.
helm upgrade --install greptimedb-operator greptime/greptimedb-operator -n default --version <chart-version>
## Upgrade CRDs

Helm cannot upgrade custom resource definitions in the `<chart>/crds` folder [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). When the CRDs are upgraded, you can upgrade CRDs by using `kubectl` manually:

```console
kubectl apply -f https://github.com/GreptimeTeam/greptimedb-operator/releases/download/<version>/greptimedbclusters.yaml
kubectl apply -f https://github.com/GreptimeTeam/greptimedb-operator/releases/download/<version>/greptimedbstandalones.yaml
```

## How to uninstall
## How to Uninstall

```console
helm uninstall greptimedb-operator -n default
helm uninstall greptimedb-operator -n greptimedb-admin
```

## Requirements
Expand Down
47 changes: 35 additions & 12 deletions charts/greptimedb-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,54 @@
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

## Source Code

- https://github.com/GreptimeTeam/greptimedb-operator

## How to install
## How to Install

### Add Chart Repository

```console
# Add charts repo.
helm repo add greptime https://greptimeteam.github.io/helm-charts/

# Update charts repo.
helm repo update
```

### Install the GreptimeDB Operator

Install greptimedb-operator in the `greptimedb-admin` namespace:

```console
helm upgrade \
--install \
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin
```

# Search charts repo.
helm search repo greptime -l --devel
If you want to specify the chart version, you can use `--version`:

# Deploy greptimedb-operator in default namespace.
helm upgrade --install greptimedb-operator greptime/greptimedb-operator -n default
```console
helm upgrade \
--install \
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin \
--version <chart-version>
```

# Specifiy the chart version.
helm upgrade --install greptimedb-operator greptime/greptimedb-operator -n default --version <chart-version>
## Upgrade CRDs

Helm cannot upgrade custom resource definitions in the `<chart>/crds` folder [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). When the CRDs are upgraded, you can upgrade CRDs by using `kubectl` manually:

```console
kubectl apply -f https://github.com/GreptimeTeam/greptimedb-operator/releases/download/<version>/greptimedbclusters.yaml
kubectl apply -f https://github.com/GreptimeTeam/greptimedb-operator/releases/download/<version>/greptimedbstandalones.yaml
```

## How to uninstall
## How to Uninstall

```console
helm uninstall greptimedb-operator -n default
helm uninstall greptimedb-operator -n greptimedb-admin
```

{{ template "chart.requirementsSection" . }}
Expand Down

0 comments on commit 33b9dc4

Please sign in to comment.