MCPcopy Index your code
hub / github.com/GreptimeTeam/gtctl

github.com/GreptimeTeam/gtctl @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
294 symbols 1,064 edges 61 files 103 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

gtctl

Overview

gtctl is a command-line tool for managing GreptimeDB cluster. gtctl integrates the multiple operations in one binary.

Getting Started

Prerequisites

  • Kubernetes 1.18 or higher version is required

You can use kind to create your own Kubernetes cluster:

$ kind create cluster

Usage

  • Create GreptimeDB cluster

$ gtctl create cluster -n mydb

  • Get GreptimeDB cluster

$ gtctl get cluster -n mydb

  • Scale GreptimeDB cluster

``` # Scale datanode to 3 replicas. $ gtctl scale cluster -n mydb -c datanode --replicas 3

# Scale frontend to 5 replicas. $ gtctl scale cluster -n mydb -c frontend --replicas 5 ```

  • Delete GreptimeDB cluster

``` # Delete GreptimeDB cluster. $ gtctl delete cluster -n mydb

# Delete GreptimeDB cluster, including etcd cluster. $ gtctl delete cluster -n mydb --tear-down-etcd ```

Development

Just make it:

$ make

Extension points exported contracts — how you extend this code

ClusterComponent (Interface)
ClusterComponent is the basic component of running GreptimeDB Cluster in bare-metal mode. [4 implementers]
pkg/components/types.go
Logger (Interface)
Logger is the new interface and base on log.Logger that from kind project.
pkg/logger/logger.go
Manager (Interface)
Manager is the interface of the metadata manager. The metadata manager is responsible for managing all the metadata of g
pkg/metadata/manager.go
Manager (Interface)
Manager is the interface for managing artifacts. For now, the artifacts can be helm charts and binaries.
pkg/artifacts/manager.go
Operations (Interface)
(no doc) [2 implementers]
pkg/cluster/types.go
Option (FuncType)
(no doc)
pkg/helm/loader.go
Option (FuncType)
(no doc)
pkg/logger/logger.go
Option (FuncType)
(no doc)
pkg/artifacts/manager.go

Core symbols most depended-on inside this repo

Errorf
called by 116
pkg/logger/logger.go
V
called by 46
pkg/logger/logger.go
Infof
called by 39
pkg/logger/logger.go
Bold
called by 15
pkg/logger/logger.go
Start
called by 12
pkg/components/types.go
Get
called by 12
pkg/cluster/types.go
Wait
called by 10
pkg/cluster/baremetal/create.go
DownloadTo
called by 9
pkg/artifacts/manager.go

Shape

Method 137
Function 94
Struct 49
Interface 6
FuncType 5
TypeAlias 3

Languages

Go100%

Modules by API surface

pkg/logger/logger.go30 symbols
pkg/artifacts/manager.go23 symbols
pkg/metadata/manager.go18 symbols
pkg/kube/client.go17 symbols
pkg/cluster/types.go17 symbols
pkg/utils/file/file.go9 symbols
pkg/config/baremetal.go9 symbols
pkg/cluster/baremetal/cluster.go9 symbols
pkg/helm/loader.go8 symbols
pkg/components/types.go7 symbols
pkg/helm/values.go6 symbols
pkg/components/metasrv.go6 symbols

For agents

$ claude mcp add gtctl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact