Overview
#
DescriptionThe Kubernetes Database-as-a-Service (DBaaS) Operator ("the Operator") is a Kubernetes Operator used to provision database instances in database management systems:
- The Operator can be easily configured and installed in a Kubernetes cluster using the provided Helm Chart.
- End-users such as software developers are able to create new database instances by writing simple Database custom resources.
- Operations on DBMS are implemented using stored procedures called by the Operator whenever necessary, allowing you to define your own custom logic.
- Credentials to access provisioned database instances are saved into Kubernetes Secrets.
Written using the Go programming language.
#
Why?#
In briefThere are cases where an organization cannot or does not want to host their critical data in cloud or distributed environments, and searches for a way to bridge the gap between their Kubernetes clusters and Database Management System (DBMS) solutions. Medium to large organizations are often composed by distinct professional figures such as software developers, system administrators and database administrators, each with its own need:
- Software developers (end-users) would like to have their DB instances provisioned as soon as possible using a user-friendly interface.
- System administrators (sysadmins) would like to have a flexible, declarative solution that is well-integrated in the Kubernetes ecosystem.
- Database administrators (DBAs) must retain control over the core business logic behind database provisioning as much as possible while still automating the process in order to save time.
#
Kubernetes operatorsThis is where an on-premise Database-as-a-Service can help to satisfy those needs. Kubernetes offers an innovative way to extend it by creating a Kubernetes operator. An operator is a specific pattern used to handle the life cycle of Kubernetes resources. Its goal is to capture the human natural way of performing tasks in order to automate processes that would otherwise be carried out manually. Due to the infinite number of possibilities when deploying and administering an application, Kubernetes can be extended using the operator pattern with the intention of encapsulating complex business logic, such as interacting with external services and performing a serie of tasks.
#
GoalsOne of the Operator's strongest goals is having a clear separation of concerns between end-users, sysadmins and DBAs: DBAs can retain full control on the life cycle of database instances by creating stored procedures or an equivalent mechanism for each operation. This decouples the configuration from the implementation and ensures a well-defined boundary between the Kubernetes and database worlds. Companies with strict compliance requirements can configure an opaque provisioning system for databases where data and business logic is kept as close as possible to their location without having to resort to a managed service; the only requirement is a formal specification under form of Kubernetes resources between the system and database infrastructures which provide the Operator with the minimal amount of information needed to communicate with each supported DBMS.
info
The Operator can be used with database management systems hosted both inside and outside a Kubernetes cluster transparently.
#
Main features- Modern tech-stack, seamless Kubernetes integration
- Level-based logging, event recording, metrics, health/readiness probes...
- Flexible and powerful configuration
- Credential rotation
- Helm deployment
- Rate-limited requests
#
Concepts#
Custom resourcesThe Operator brings 3 new custom resources into the cluster:
Database
resources are used to describe Database instances.DatabaseClass
resources describe the format of the operations to be executed on DB systems, what driver should be used to call operations and how data should be saved intoSecrets
.OperatorConfig
is like a specializedConfigMap
used to configure the Operator depending on the needs of the user organization. It contains also the list of DBMS endpoints, including their DSN, bindings them to a particularDatabaseClass
.
#
OperationsThere are currently 3 operations supported by the Operator:
- Database creation
- Database deletion
- Database credential rotation
The control loop of the Operator can be summarized by means of the following flowchart:
#
An exampleThe following diagram shows what happens when an operation is executed on
a Database
resource:
- The Operator watches the cluster for a new event generated by a Database resource, i.e. creation, deletion or credential rotation.
- The Operator calls the relative stored procedure or equivalent mechanism on the DBMS.
- The DBMS executes the stored procedure according to the implementation of the database administrator.
- Finally, the Operator acts on the Secret by creating, deleting or updating it with the data returned by the operation.
#
Supported DBMSSee Supported DBMS.