k8s-external-database-operator

command module
v0.0.0-...-33090a2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 11 Imported by: 0

README

External database operator for Kubernetes

This operator helps you to manage (self-)hosted databases in your Kubernetes clusters by defining them with Custom-Resources. It will automatically handle creation, updates & removal of your external databases.

Example: You are deploying a guestbook web-application. For the app you need some kind of deployment, a service, an ingress route and a database. As you do already have an external database system hosted outside Kubernetes you only want an automatic generation of a new database in that system with a new user for your application.

This can be done with the following manifest:

apiVersion: anbraten.github.io/v1alpha1
kind: Database
metadata:
  name: guestbook-database
spec:
  type: mongo
  database: guestbook
  username: guestbook-admin
  password: iwonttellyou

Important note: 🚨 Changing database settings (type, database, username, password) will possibly re-create the corresponding data and wont migrate the database or user (data-loss of old database & custom user settings).

Supported database types

  • mongo ✅
  • couchdb ✅
  • mysql ✅
  • postgres ✅
  • mssql ✅

Deployment

  1. Adjust the secrets in deploy/database-secrets.yml to your needs.
  2. Deploy them using: kubectl apply -f deploy/database-secrets.yml
  3. Deploy the controller using: kubectl apply -f https://github.com/anbraten/k8s-external-database-operator/releases/latest/download/external-database-controller.yml

Release

To release a new version of the controller run:

export VERSION="0.0.1"
export IMG="anbraten/external-database-operator:${VERSION}"
make docker-build
make docker-push
make generate-manifests
cat deploy/external-database-controller.yml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=anbraten.github.io
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=anbraten.github.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL