{"id":20001149,"url":"https://github.com/apecloud/dbctl","last_synced_at":"2026-05-13T14:33:17.225Z","repository":{"id":245832018,"uuid":"819340040","full_name":"apecloud/dbctl","owner":"apecloud","description":"the repository for db engines codes","archived":false,"fork":false,"pushed_at":"2024-12-20T03:16:50.000Z","size":454,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-12T13:11:17.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apecloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-24T10:03:25.000Z","updated_at":"2024-12-20T03:16:53.000Z","dependencies_parsed_at":"2024-08-19T10:42:36.418Z","dependency_job_id":"8473514f-6be0-4adb-8e8c-40829d48adae","html_url":"https://github.com/apecloud/dbctl","commit_stats":null,"previous_names":["apecloud/lorry","apecloud/dbctl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fdbctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fdbctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fdbctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apecloud%2Fdbctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apecloud","download_url":"https://codeload.github.com/apecloud/dbctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439474,"owners_count":19963098,"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":[],"created_at":"2024-11-13T05:16:50.540Z","updated_at":"2026-05-13T14:33:17.220Z","avatar_url":"https://github.com/apecloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbctl\ndbctl is a service that provides command execution channels, originally found in KubeBlocks. It offers implementations of actions for various well-known database engines, such as apecloud-MySQL, MySQL, Redis, PostgreSQL, MongoDB, and others. For the database engines supported by dbctl, when integrating addons, you can declare dbctl as an engines plugin, enabling quick integration with KubeBlocks.\n\ndbctl itself provides two running modes: daemon mode and temporary task mode. You can choose the appropriate mode based on your business scenario.\n\n## Daemon Mode\nIn this mode, dbctl runs as a daemon process and provides API services. This can be treated as one form of implementing the engine plugin. KubeBlocks does not impose restrictions on the form of engines plugins; they can run as sidecars, container daemons, or other forms. Currently, dbctl uses the localhost address to communicate with the database processes by default. Therefore, in this mode, it is recommended to deploy dbctl using the sidecar method, with the deployment template as follows:\n```\napiVersion: v1\nkind: Pod\nspec:\n  containers:\n  - name: mysql\n    image: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/apecloud-mysql-server:8.0.30\n    ...\n  - name: dbctl\n    image: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/dbctl:0.2.0\n    command:\n    - dbctl\n    - mysql\n    - service\n    env:\n    - name: KB_POD_NAME\n      valueFrom:\n        fieldRef:\n          apiVersion: v1\n          fieldPath: metadata.name\n    - name: KB_SERVICE_USER\n      valueFrom:\n        secretKeyRef:\n          key: username\n          name: cluster-mysql-account-root\n    - name: KB_SERVICE_PASSWORD\n      valueFrom:\n        secretKeyRef:\n          key: password\n          name: cluster-mysql-account-root\n```\n\nWhen using dbctl in daemon mode, action definitions can be implemented by calling the dbctl API:\n```\n  lifecycleActions:\n    roleProbe:\n      exec:\n        command:\n          - /bin/bash\n          - -c\n          - curl -X GET -H 'Content-Type: application/json' 'http://127.0.0.1:5001/v1.0/getrole'\n```\n\n## Temporary Task\nIn this mode, dbctl completes the corresponding task and then exits immediately. It is suitable for use as a tool and can be called directly in actions. For a list of supported actions and their usage, please refer to the documentation in the [docs](docs/user_docs/dbctl.md).\n\n```\n  lifecycleActions:\n    roleProbe:\n      exec:\n        image: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/dbctl:0.2.0\n        command:\n          - dbctl\n          - mysql\n          - getrole\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapecloud%2Fdbctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapecloud%2Fdbctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapecloud%2Fdbctl/lists"}