Skip to content

Commit

Permalink
docs: update readme (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 authored Aug 21, 2024
1 parent d0f67c8 commit eb7e52f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 32 deletions.
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ You can run the following command to see the charts:
helm search repo greptime
```

### OCI Artifacts

Besides using the GitHub chart repo, you can also use OCI artifacts.

The charts are also available in ACR namespace `greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts`.

You don't have to add a chart repository explicitly when using OCI artifacts, for example:

```console
helm upgrade \
--install \
--create-namespace \
--set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \
greptimedb-operator oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-operator \
-n greptimedb-admin
```

The chart name and version will remain consistent with the GitHub chart repo.

### Install the GreptimeDB Cluster

If you want to deploy the GreptimeDB cluster, you can use the following commands:
Expand All @@ -43,6 +62,8 @@ If you want to deploy the GreptimeDB cluster, you can use the following commands
-n etcd-cluster
```

You can also use `oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/etcd:10.2.12`.

2. **Deploy GreptimeDB operator**

The greptimedb-operator will install in the `greptimedb-admin` namespace:
Expand Down Expand Up @@ -91,14 +112,17 @@ If you want to deploy the GreptimeDB cluster, you can use the following commands
4. **Use `kubectl port-forward` to access the GreptimeDB cluster**

```console
# You can use the MySQL client to connect the cluster, for example: 'mysql -h 127.0.0.1 -P 4002'.
kubectl port-forward -n default svc/mycluster-frontend 4002:4002 > connections.out &
# You can use the PostgreSQL client to connect the cluster, for example: 'psql -h 127.0.0.1 -p 4003 -d public'.
kubectl port-forward -n default svc/mycluster-frontend 4003:4003 > connections.out &
# You can use the MySQL or PostgreSQL client to connect the cluster, for example: 'mysql -h 127.0.0.1 -P 4002'.
kubectl port-forward -n default svc/mycluster-frontend 4001:4001 4002:4002 4003:4003 4000:4000 > connections.out &
```

You also can read and write data by [Cluster](https://docs.greptime.com/user-guide/cluster).
If you want to expose the service to the public, you can use the `kubectl port-forward` command with the `--address` option:

```console
kubectl port-forward --address 0.0.0.0 svc/mycluster-frontend 4001:4001 4002:4002 4003:4003 4000:4000 > connections.txt &
```

You can also read and write data using refer to the [docs](https://docs.greptime.com/user-guide/cluster).

### Upgrade

Expand All @@ -114,8 +138,6 @@ For example:
helm upgrade --install mycluster greptime/greptimedb-cluster --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:
Expand All @@ -126,7 +148,9 @@ 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:
The CRDs of GreptimeDB are **not deleted by default** after uninstalling greptimedb-operator unless you use `--set crds.keep=false`.

You can delete CRDs manually by the following commands:

```console
kubectl delete crds greptimedbclusters.greptime.io
Expand Down
2 changes: 1 addition & 1 deletion charts/greptimedb-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kubeVersion: ">=1.18.0-0"
description: The greptimedb-operator Helm chart for Kubernetes.
name: greptimedb-operator
appVersion: 0.1.0-alpha.29
version: 0.2.2
version: 0.2.3
type: application
home: https://github.com/GreptimeTeam/greptimedb-operator
sources:
Expand Down
24 changes: 13 additions & 11 deletions charts/greptimedb-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The greptimedb-operator Helm chart for Kubernetes.

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

## Source Code

Expand Down Expand Up @@ -40,13 +40,21 @@ helm upgrade \
--version <chart-version>
```

## Installation and upgrade of CRDs
## How to Uninstall

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

## CRDs Management

### Installation and Upgrade of the 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).

**We support CRD installation and upgrade automatically using the chart for deployment convenience**. You can disable the CRD installation by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default**.
For deployment convenience, we have decided to manage the CRDs using the Helm chart since **v0.2.1**. By default, the chart will automatically install or upgrade the CRDs. You can disable the behavior by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default** unless you use `--set crds.keep=false`.

If the previous version of the chart already installs your CRDs, you have to modify some metadata of CRDs before installing the new version of the chart:
If you installed the CRD using a chart version before v0.2.1 and want to let the chart manage CRDs, you can add some necessary metadata for the original CRDs:

```console
# Add the following labels to the CRDs.
Expand All @@ -72,13 +80,7 @@ If you want to upgrade CRDs manually, you can use the following steps (**ensure
make upgrade-crds CRDS_VERSION=latest
```

## How to Uninstall

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

## How to Update the CRDs in the Chart
### How to Update the CRDs in the Chart

If you want to update the CRDs in the chart, you can use the following steps:

Expand Down
24 changes: 13 additions & 11 deletions charts/greptimedb-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ helm upgrade \
--version <chart-version>
```

## Installation and upgrade of CRDs
## How to Uninstall

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

## CRDs Management

### Installation and Upgrade of the 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).
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).

**We support CRD installation and upgrade automatically using the chart for deployment convenience**. You can disable the CRD installation by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default**.
For deployment convenience, we have decided to manage the CRDs using the Helm chart since **v0.2.1**. By default, the chart will automatically install or upgrade the CRDs. You can disable the behavior by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default** unless you use `--set crds.keep=false`.

If the previous version of the chart already installs your CRDs, you have to modify some metadata of CRDs before installing the new version of the chart:
If you installed the CRD using a chart version before v0.2.1 and want to let the chart manage CRDs, you can add some necessary metadata for the original CRDs:

```console
# Add the following labels to the CRDs.
Expand All @@ -71,13 +79,7 @@ If you want to upgrade CRDs manually, you can use the following steps (**ensure
make upgrade-crds CRDS_VERSION=latest
```

## How to Uninstall

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

## How to Update the CRDs in the Chart
### How to Update the CRDs in the Chart

If you want to update the CRDs in the chart, you can use the following steps:

Expand Down

0 comments on commit eb7e52f

Please sign in to comment.