Code Monkey home page Code Monkey logo

db-operator's Introduction

DB Operator

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.

Features

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);

Documentations

Quickstart

TODO: update when public helm repo set up done to not use local helm chart

To install DB Operator with helm:

$ 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

Development

Prerequisites

To have kubernetes environment locally, you can set minikube or microk8s up.

makefile help

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)

Developing with Minikube

How to run db-operator

$ make miniup
$ make setup

After code changes

rebuild local docker image

$ make build

delete running db-operator and apply new image

$ make deploy

or both at once

$ make update

After helm template changes

$ make helm

helm upgrade --install -f {LOCAL CHART DIR}/values-local.yaml {LOCAL CHART DIR}

Developing with microk8s

  • Microk8s supports only linux environment. Non linux user can use microk8s using vm for example multipass. Please find details here

How to run db-operator

$ make microsetup

microsetup is used for our integration test in pipeline.

Run unit test locally

$ make test

db-operator's People

Contributors

dabde avatar dpeckett avatar hyunysmile avatar sookloeckner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.