The DB Operator eases the pain of managing PostgreSQL and MySQL instances for applications running in Kubernetes. The Operator creates databases and make them available in the cluster via Custom Resource. It is designed to support the on demand creation of test environments in CI/CD pipelines.
DB Operator provides following features:
- Create/Delete databases on the database server running outside/inside Kubernetes by creating
Database
custom resource; - Create Google Cloud SQL instances by creating
DbInstance
custom resource; - Automatically create backup
CronJob
with defined schedule (limited feature);
- How it works - a general overview and definitions
- Creating Instances - make database instances available for the operator
- Creating Databases - creating databases in those instances
- Enabling regular Backup - and schedule cronjob
TODO: update when public helm repo set up done to not use local helm chart
$ helm repo add myhelmrepo https://kloeckner-i.github.io/db-operator/helm/
$ helm install --name my-release myhelmrepo/db-operator
To see more options of helm values here
- go 1.12+
- docker
- operator-sdk v0.13.0
- make
- kubectl v1.14+(< v1.19)
- helm 2.11+
- minikube or microk8s
To have kubernetes environment locally, you can set minikube or microk8s up.
make miniup: start minikube
make minidown: stop minikube
make minidelete: delete minikube
make minidashboard: open minikube dashboard
make build: build db-operator docker image using operator-sdk
make helm: install helm if not exist and install local chart using helm upgrade --install command
make setup: build db-operator image, install helm
make update: build db-operator image again and delete running pod
make addexamples: kubectl create -f examples/
make test: spin up mysql, postgres containers and run go unit test
make microsetup: install microk8s locally and deploy db-operator (only for linux)
$ make miniup
$ make setup
rebuild local docker image
$ make build
delete running db-operator and apply new image
$ make deploy
or both at once
$ make update
$ make helm
helm upgrade --install -f {LOCAL CHART DIR}/values-local.yaml {LOCAL CHART DIR}
- Microk8s supports only linux environment. Non linux user can use microk8s using vm for example multipass. Please find details here
$ make microsetup
microsetup is used for our integration test in pipeline.
$ make test