Kubernetes DbaaS
A Kubernetes Database as a Service (DBaaS) Operator for non-Kubernetes managed database management systems.
Abstract
This project aims at creating a Kubernetes Operator able to trigger a stored procedure in an external DBMS which in turn provisions a new database instance.
Users are able to create new database instances by writing the API Object configuration using Kubernetes Custom Resources.
The Operator watches for new API Objects and tells the target DBMS to trigger a certain stored procedure based on the custom resource specs.
Motivation
There are many cases where a company can't or doesn't want to host their precious data in cloud or distributed environments and simply desire a way to bridge the gap between their K8s clusters and DBMS solutions. Imagine an organization composed by developers and system administrators, the former want their database provisioned ASAP whereas the latter want to have as much control as possible on the procedure needed to provision databases while still automating repetitive tasks. If this sounds interesting, keep reading.
Main technologies
- Go 1.15 or newer
- operator-sdk v1.3.x
- Kubernetes v1.19.0 or newer
- Helm v3
Features
Create database

Delete database

To-do
- Implement additional DBMS drivers (see supported DBMS)
- Test the controller with KUTTL
- Tests refactoring
- Extend the Helm chart for a larger number of use cases
- Support db connections encryption
- Scalable controller
- Metrics
Manuals
Please setup the Operator using the Sysadmin guide. After that, End-users or testers can use the End-user guide to learn how to provision a database through the Operator.
Those who wish to contribute to the code should read the contributor guide.
Supported DBMS
- SQLServer
- PostgreSQL (to be implemented)
- MariaDB (to be implemented)
Additional notes
The operator doesn't support encrypted DBMS connections yet.
Quickstart
To try out the Operator on your local development machine, follow these steps:
- Install Go 1.15+ https://golang.org/doc/install
- Install kubectl v1.19+ https://kubernetes.io/docs/tasks/tools/install-kubectl/
- Install minikube v1.16+ https://minikube.sigs.k8s.io/docs/start/
- Install the operator-sdk and its prerequisites: https://sdk.operatorframework.io/docs/installation/
- Rename
config.example.yaml
to config.yaml
- Configure the Operator by following the System administrator guide
chmod +x start.sh
./start.sh
- Create and delete a custom resource by following the End-user guide
You can also use the supplied Dockerfile to compile your own Docker image.
For more information about the operator-sdk and the enclosed Makefile, consult: https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/
CLI arguments
--config-path <path>
defines the configuration file path. If no path is supplied, the Operator will search in the same folder of the manager binary for a file called config.yaml
.
Known problems
- Given that all errors are written in the resources'
LastError
status field, some things that should stay hidden, might leak to unauthorized personnel. There should be a way to hide the details from the End-users, while still logging them.
Code reference
To be done (godoc present on the code).
Tests
Contribute
Credits
License