{"id":19684053,"url":"https://github.com/bonsai-oss/external-db-operator","last_synced_at":"2026-02-26T16:21:56.847Z","repository":{"id":215924069,"uuid":"739525890","full_name":"bonsai-oss/external-db-operator","owner":"bonsai-oss","description":"Kubernetes operator configuring out of cluster databases","archived":false,"fork":false,"pushed_at":"2025-03-31T20:00:45.000Z","size":206,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T20:34:40.233Z","etag":null,"topics":["cockroachdb","databases","kubernetes","mariadb","mysql","operator","postgresql"],"latest_commit_sha":null,"homepage":"https://gitlab.com/bonsai-oss/kubernetes/external-db-operator","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bonsai-oss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-05T19:26:00.000Z","updated_at":"2025-03-31T19:41:16.000Z","dependencies_parsed_at":"2025-02-06T16:31:40.388Z","dependency_job_id":"2e0c1515-1b1c-4951-bdc4-31a19fe91bed","html_url":"https://github.com/bonsai-oss/external-db-operator","commit_stats":null,"previous_names":["bonsai-oss/external-db-operator"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fexternal-db-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fexternal-db-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fexternal-db-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonsai-oss%2Fexternal-db-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bonsai-oss","download_url":"https://codeload.github.com/bonsai-oss/external-db-operator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251444659,"owners_count":21590547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cockroachdb","databases","kubernetes","mariadb","mysql","operator","postgresql"],"created_at":"2024-11-11T18:16:43.012Z","updated_at":"2026-02-26T16:21:51.827Z","avatar_url":"https://github.com/bonsai-oss.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# External-DB-Operator\n\nThe External DB Operator is a project that aims to simplify the management of out-of-cluster databases.\nIt was created to address the following problems:\n- Out-of-cluster databases are not managed by kubernetes and therefore not part of the cluster lifecycle.\n- Manually managing database connection information does not provide a good base for automation.\n\nOperator Key Features:\n- Lifecycle management of dbms side databases, user accounts and database grants\n- Exposing database details as kubernetes secret\n- Support for multiple database providers (see [Supported Databases](#supported-databases))\n\n### Requirements\n\n* Kubernetes (tested with \u003e= v1.28.3)\n* Admin user access to one of the supported databases (see [Supported Databases](#supported-databases))\n\n## Supported Databases\n\nThe following database management systems are supported and tested. Compatible products should work as well but are not tested. \\\nPlease submit an issue if you encounter any problems or have a feature request.\n\n| Database                  | Provider   | Library                                                       |\n|---------------------------|------------|---------------------------------------------------------------|\n| PostgreSQL / CockroachDB  | `postgres` | [pgx](https://github.com/jackc/pgx)                           |\n| MySQL / MariaDB / Percona | `mysql`    | [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |\n\n\nSupport for other databases can be added by implementing the [Provider](internal/database/database.go) interface.\n\n## Usage\n\n### Getting Started\n\nThe operator can be deployed to a cluster via the example [manifests](manifests) directory.\\\nFirst, create the necessary rbac and crd resources:\n\n```shell\nkubectl apply -f manifests/rbac.yaml\nkubectl apply -f manifests/crd.yaml\n```\n\nModify the [manifests/deployment.yaml](manifests/deployment.yaml) file to include the correct database dsn and provider.\\\nThen, deploy the operator:\n\n```shell\nkubectl apply -f manifests/deployment.yaml\n```\n\n---\n\nOnce the operator is deployed to the cluster, it will start watching for `bonsai-oss.org/v1/database` resources in all namespaces.\n\nThe name of the operator is specified via the `--instance-name` / `-i` flag and the used database provider in pattern `\u003cprovider\u003e-\u003cinstance-name\u003e`. An example for PostgreSQL would be `postgres-default`.\\\nThat name is used to select the operator instance responsible for a specific database resource and can be specified via the `bonsai-oss.org/external-db-operator` label. See [manifests/test-database.yaml](manifests/test-database.yaml) for an example.\n\nAfter creating the database resources, the operator will create a secret containing the database connection details (database, host, port, username, password) in the same namespace as the database resource.\nIt is named with the pattern `\u003csecret_prefix\u003e-\u003cresource_name\u003e` (e.a. `edb-your-database`). \n\nWhen adding additional annotations / labels to the database resource, the operator will pass them to the secret as well.\n\n### Parameters\n\n| Parameter                                         | Description                                                                                    | Default                                              |\n|---------------------------------------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| `-p`, `--database-provider`, `$DATABASE_PROVIDER` | Database provider to use.                                                                      | postgres                                             |\n| `-d`, `--database-dsn`, `$DATABASE_DSN`           | The DSN to use for the database provider.\u003cbr/\u003e Check the specific database libaray for format. | postgres://postgres:postgres@localhost:5432/postgres |\n| `-i`, `--instance-name`, `$INSTANCE_NAME`         | Name of the operator instance                                                                  | default                                              |\n| `-s`, `--secret-prefix`, `$SECRET_PREFIX`         | Prefix for the secret name                                                                     | edb                                                  |\n\n### Endpoints\n\nThe operator exposes the following endpoints on http port `8080`.\n\n| Endpoint   | Description                                                                                                                       |\n|------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| `/status`  | Health check endpoint. Returns 200 if the operator is running and healthy. \u003cbr\u003e Also, some information is exposed in JSON format. |\n| `/metrics` | Prometheus metrics endpoint.                                                                                                      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonsai-oss%2Fexternal-db-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonsai-oss%2Fexternal-db-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonsai-oss%2Fexternal-db-operator/lists"}