kubernetes-dbaas

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

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

k8s_dbaas_bedag_create

Delete database

k8s_dbaas_bedag_delete

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:

  1. Install Go 1.15+ https://golang.org/doc/install
  2. Install kubectl v1.19+ https://kubernetes.io/docs/tasks/tools/install-kubectl/
  3. Install minikube v1.16+ https://minikube.sigs.k8s.io/docs/start/
  4. Install the operator-sdk and its prerequisites: https://sdk.operatorframework.io/docs/installation/
  5. Rename config.example.yaml to config.yaml
  6. Configure the Operator by following the System administrator guide
  7. chmod +x start.sh
  8. ./start.sh
  9. 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the dbaas v1 API group +kubebuilder:object:generate=true +groupName=dbaas.bedag.ch
Package v1 contains API Schema definitions for the dbaas v1 API group +kubebuilder:object:generate=true +groupName=dbaas.bedag.ch
Package cmd contains the CLI command definitions along with their initialization and startup code
Package cmd contains the CLI command definitions along with their initialization and startup code
pkg
pool
This package attempts at opening a nd retaining a pool of distinct DBMS connections TODO: Versioning.
This package attempts at opening a nd retaining a pool of distinct DBMS connections TODO: Versioning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳