MCPcopy
hub / github.com/apecloud/kubeblocks

github.com/apecloud/kubeblocks @v1.0.2 sqlite

repository ↗ · DeepWiki ↗ · release v1.0.2 ↗
9,567 symbols 37,590 edges 1,095 files 4,218 documented · 44%
README

Welcome to the KubeBlocks project!

Documentation status OpenSSF Best Practices CICD Push CodeQL Releases Release LICENSE Go Report Card Docker Pulls Codecov maturity Artifact Hub

image

Motivation

If you are a developer using multiple types of databases in your application and are considering deploying both your application and databases on K8s for cost or efficiency reasons, you need to find suitable operators for each database. Learning so many different operators and their APIs introduces a significant learning curve and time costs, not to mention the effort required to maintain them.

KubeBlocks uses a unified set of APIs (CRDs) and code to manage various databases on K8s. For example, we can use the Cluster resource to create a PostgreSQL cluster, a Redis cluster, or a Kafka cluster. This abstraction and unified API allow us to further use a single set of operator code to manage multiple types of databases, as well as handle day-2 operations, theoretically extending to any type of database engine.

What is KubeBlocks

KubeBlocks is an open-source control plane software that runs and manages multiple popular database engines on K8s through a unified set of code and APIs. The core of KubeBlocks is a K8s operator, which defines a set of CRDs to abstract the common attributes of various database engines and uses these abstractions to manage the engine's lifecycle and day-2 operations.

KubeBlocks manages various types of stateful engines, including RDBMSs (MySQL, PostgreSQL), Caches(Redis), NoSQLs (MongoDB), MQs(Kafka, Pulsar), vector databases(Milvus, Qdrant, Weaviate), and data warehouses(ClickHouse, ElasticSearch, OpenSearch, Doris, StarRocks). Adding a new engine to KubeBlocks can be achieved by writing a KubeBlocks Addon. The community is actively integrating more types of engines into KubeBlocks, and it currently supports 35 types of engines.

The name KubeBlocks is inspired by Kubernetes and LEGO blocks, signifying that through the KubeBlocks API, adding, composing and managing database engines on K8s can be easy, standard and productive, like playing with LEGO blocks.

Why you need KubeBlocks

KubeBlocks integrates the most popular database engines and provides rich management functions, along with declarative APIs, in various environments. KubeBlocks offers the following benefits:

  • Production-level

KubeBlocks has already been adopted by large internet companies, private clouds, the financial industry including banks and securities firms, telecom industry, the automotive industry, and SaaS software providers.

  • Reliability

KubeBlocks supports the integration of various mature high-availability best practices, such as Orchestrator, Patroni, and Sentinel. KubeBlocks also supports full backups, continuous backups, and point-in-time recovery (PITR).

  • Ease of use

KubeBlocks not only provides a YAML-based API but also offers an interactive kbcli tool to further simplify usage as a complement to kubectl. For example, you can install KubeBlocks and launch a playground environment on a desktop or cloud with a single command.

  • Observability

KubeBlocks collects monitoring metrics from rich data sources, integrates with the Prometheus stack, and provides insightful Grafana templates. In addition, troubleshooting tools such as slow logs are also provided.

  • Extensibility

KubeBlocks provides the addon mechanism for integrating new engines. So it can be extended to run the databases your project needs.

Goals

  • Smoothing the learning curve of managing various databases on K8s
  • Exploring standard APIs for managing databases on Kubernetes
  • Being open and cloud-neutral, as well as engine-neutral

Key features

  • Supports various databases, including MySQL, PostgreSQL, Redis, MongoDB, Kafka, Clickhouse, ElasticSearch and more
  • Provides production-level performance, resilience, and observability
  • Simplifies day-2 operations, such as upgrading, scaling, monitoring, backup, and restore
  • Contains a powerful and intuitive command line tool
  • Be compatible with AWS, GCP, Azure, Alibaba Cloud and more CSP

Get started with KubeBlocks

Quick Start shows you the quickest way to get started with KubeBlocks.

Resources

API Reference

How to write a KubeBlocks Addon?

KubeBlocks: Cloud-Native Data Infrastructure for Kubernetes (A Video made by Viktor Farcic)

Dashboard Demo

KubeBlocks at KubeCon

KubeCon 2024 in HongKong from 21-23 August 2024: How to Manage Database Clusters Without a Dedicated Operator, By Shanshan Ying, ApeCloud & Shun Ding, China Mobile Cloud

KubeCon 2024 in HongKong from 21-23 August 2024: KuaiShou's 100% Resource Utilization Boost: 100K Redis Migration from Bare Metal to Kubernetes, By XueQiang Wu, ApeCloud & YuXing Liu, Kuaishou

Community

If you have any questions, you can reach out to us through:

wechat

You can also follow us on:

Contributing to KubeBlocks

Your contributions are welcomed and appreciated.

Report Vulnerability

We consider security as the top priority issue. If you find any security issues, please Report a security vulnerability issue.

License

KubeBlocks is under the GNU Affero General Public License v3.0. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

ConfigConstraintLister (Interface)
ConfigConstraintLister helps list ConfigConstraints. All objects returned here must be treated as read-only. [110 implementers]
pkg/client/listers/apps/v1beta1/configconstraint.go
Plan (Interface)
Plan defines the final actions should be executed. [10 implementers]
pkg/controller/graph/plan_builder.go
PObject (Interface)
PObject pointer of Object [580 implementers]
pkg/generics/type.go
InformerManager (Interface)
(no doc) [6 implementers]
controllers/trace/informer_manager.go
Client (Interface)
(no doc) [17 implementers]
pkg/kbagent/client/client.go
OpsHandler (Interface)
(no doc) [14 implementers]
pkg/operations/type.go
DynamicParamUpdater (Interface)
DynamicParamUpdater is designed to adapt to the dapper implementation. [3 implementers]
pkg/configuration/config_manager/reconfiguring_wrapper.go
ConfigObject (Interface)
(no doc) [4 implementers]
pkg/unstructured/type.go

Core symbols most depended-on inside this repo

To
called by 416
pkg/controller/graph/dag.go
Get
called by 373
pkg/unstructured/type.go
Do
called by 352
pkg/controller/model/graph_client.go
Create
called by 315
pkg/controller/model/graph_client.go
DeepCopy
called by 301
pkg/generics/type.go
GetObject
called by 259
pkg/testutil/apps/base_factory.go
Get
called by 253
controllers/trace/change_capture_store.go
Error
called by 235
controllers/dataprotection/backuprepo_controller.go

Shape

Method 5,120
Function 2,625
Struct 1,318
Interface 320
TypeAlias 148
FuncType 36

Languages

Go100%

Modules by API surface

apis/apps/v1alpha1/zz_generated.deepcopy.go329 symbols
apis/apps/v1/zz_generated.deepcopy.go278 symbols
apis/dataprotection/v1alpha1/zz_generated.deepcopy.go180 symbols
apis/operations/v1alpha1/zz_generated.deepcopy.go130 symbols
apis/parameters/v1alpha1/zz_generated.deepcopy.go92 symbols
pkg/controller/component/vars.go76 symbols
controllers/apps/cluster/transformer_cluster_component.go72 symbols
apis/apps/v1/componentdefinition_types.go68 symbols
controllers/dataprotection/backuprepo_controller.go67 symbols
apis/apps/v1alpha1/cluster_types.go63 symbols
controllers/extensions/addon_controller_stages.go55 symbols
apis/apps/v1alpha1/type.go54 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

cuelabs.dev/go/oci/ociregistryv0.0.0-2024031415212 · 1×
cuelang.org/gov0.8.0 · 1×
github.com/Azure/go-ansitermv0.0.0-2023012417243 · 1×
github.com/DATA-DOG/go-sqlmockv1.5.0 · 1×
github.com/Masterminds/goutilsv1.1.1 · 1×
github.com/Masterminds/semver/v3v3.2.1 · 1×
github.com/Masterminds/sprig/v3v3.2.3 · 1×
github.com/Microsoft/go-winiov0.6.2 · 1×
github.com/StudioSol/setv1.0.0 · 1×
github.com/andybalholm/brotliv1.0.5 · 1×
github.com/asaskevich/govalidatorv0.0.0-2023030114320 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

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

⬇ download graph artifact