Skip to main content
Version: nightly

GreptimeDB Operator Management

The GreptimeDB Operator manages the GreptimeDB resources on Kubernetes using the Operator pattern.

It is like an autopilot that automates the deployment, provisioning, and orchestration of the GreptimeDB cluster and standalone.

The GreptimeDB Operator includes, but is not limited to, the following features:

  • Automated Provisioning: Automates the deployment of the GreptimeDB cluster and standalone on Kubernetes by providing CRD GreptimeDBCluster and GreptimeDBStandalone.

  • Multi-Cloud Support: Users can deploy the GreptimeDB on any Kubernetes cluster, including on-premises and cloud environments(like AWS, GCP, Aliyun, etc.).

  • Scaling: Scale the GreptimeDB cluster as easily as changing the replicas field in the GreptimeDBCluster CR.

  • Monitoring Bootstrap: Bootstrap the GreptimeDB monitoring stack for the GreptimeDB cluster by providing the monitoring field in the GreptimeDBCluster CR.

This document will show you how to install, upgrade, configure, and uninstall the GreptimeDB Operator on Kubernetes.

note

The following output may have minor differences depending on the versions of the Helm charts and environment.

Prerequisites

  • Kubernetes >= v1.18.0
  • kubectl >= v1.18.0
  • Helm >= v3.0.0

Production Deployment

For production deployments, it's recommended to use Helm to install the GreptimeDB Operator.

Installation

You can refer Install and verify the GreptimeDB Operator for detailed instructions.

note

If you are using Argo CD to deploy applications, please make sure that the Application has set the ServerSideApply=true to enable the server-side apply (other GitOps tools may have similar settings).

Upgrade

We always publish the latest version of the GreptimeDB Operator as a Helm chart in our official Helm repository.

When the new version of the GreptimeDB Operator is released, you can upgrade the GreptimeDB Operator by running the following commands.

Update the Helm repository

helm repo update greptime
Expected Output
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "greptime" chart repository
Update Complete. ⎈Happy Helming!⎈

You can use the following command to search the latest version of the GreptimeDB Operator:

helm search repo greptime/greptimedb-operator
Expected Output
NAME                        	CHART VERSION	APP VERSION  	DESCRIPTION
greptime/greptimedb-operator 0.2.9 0.1.3-alpha.1 The greptimedb-operator Helm chart for Kubernetes.

You also can use the following command to list all the available versions:

helm search repo greptime/greptimedb-operator --versions

Upgrade the GreptimeDB Operator

You can upgrade to the latest released version of the GreptimeDB Operator by running the following command:

helm -n greptimedb-admin upgrade greptimedb-operator greptime/greptimedb-operator
Expected Output
Release "greptimedb-operator" has been upgraded. Happy Helming!
NAME: greptimedb-operator
LAST DEPLOYED: Mon Oct 28 19:30:52 2024
NAMESPACE: greptimedb-admin
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
***********************************************************************
Welcome to use greptimedb-operator
Chart version: 0.2.9
GreptimeDB Operator version: 0.1.3-alpha.1
***********************************************************************

Installed components:
* greptimedb-operator

The greptimedb-operator is starting, use `kubectl get deployments greptimedb-operator -n greptimedb-admin` to check its status.

If you want to upgrade to a specific version, you can use the following command:

helm -n greptimedb-admin upgrade greptimedb-operator greptime/greptimedb-operator --version <version>

After the upgrade is complete, you can use the following command to verify the installation:

helm list -n greptimedb-admin
Expected Output
NAME                    NAMESPACE               REVISION        UPDATED                                 STATUS          CHART                           APP VERSION  
greptimedb-operator greptimedb-admin 1 2024-10-30 17:46:45.570975 +0800 CST deployed greptimedb-operator-0.2.9 0.1.3-alpha.1

CRDs

There are two kinds of CRD that are installed with the GreptimeDB Operator: GreptimeDBCluster and GreptimeDBStandalone.

You can use the following command to verify the installation:

kubectl get crd | grep greptime
Expected Output
greptimedbclusters.greptime.io      2024-10-28T08:46:27Z
greptimedbstandalones.greptime.io 2024-10-28T08:46:27Z

By default, the GreptimeDB Operator chart will manage the installation and upgrade of the CRDs and the users don't need to manage them manually. If you want to know the specific definitions of these two types of CRD, you can refer to the GreptimeDB Operator API documentation.

Configuration

The GreptimeDB Operator chart provides a set of configuration options that allow you to customize the installation, you can refer to the GreptimeDB Operator Helm Chart for more details.

You can create a values.yaml to configure the GreptimeDB Operator chart (the complete configuration of values.yaml can be found in the chart), for example:

image:
# -- The image registry
registry: docker.io
# -- The image repository
repository: greptime/greptimedb-operator
# -- The image pull policy for the controller
imagePullPolicy: IfNotPresent
# -- The image tag
tag: latest
# -- The image pull secrets
pullSecrets: []

replicas: 1

resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi

You can use the following command to install the GreptimeDB Operator with the custom configuration:

helm -n greptimedb-admin install greptimedb-operator greptime/greptimedb-operator -f values.yaml

If you want to upgrade the GreptimeDB Operator with the custom configuration, you can use the following command:

helm -n greptimedb-admin upgrade greptimedb-operator greptime/greptimedb-operator -f values.yaml

You also can use one command to install or upgrade the GreptimeDB Operator with the custom configuration:

helm -n greptimedb-admin upgrade --install greptimedb-operator greptime/greptimedb-operator -f values.yaml

Uninstallation

You can use the helm command to uninstall the GreptimeDB Operator:

helm -n greptimedb-admin uninstall greptimedb-operator

We don't delete the CRDs by default when you uninstall the GreptimeDB Operator.

danger

If you really want to delete the CRDs, you can use the following command:

kubectl delete crd greptimedbclusters.greptime.io greptimedbstandalones.greptime.io

The related resources will be removed after you delete the CRDs.