Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anbraten/k8s-external-database-operator
Use externally hosted databases in your kubernetes cluster.
https://github.com/anbraten/k8s-external-database-operator
couchdb k8s k8s-operator mongodb mssql mysql postgresql sqlserver
Last synced: about 2 months ago
JSON representation
Use externally hosted databases in your kubernetes cluster.
- Host: GitHub
- URL: https://github.com/anbraten/k8s-external-database-operator
- Owner: anbraten
- License: mit
- Created: 2021-01-23T12:47:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T09:46:44.000Z (about 1 year ago)
- Last Synced: 2024-11-15T01:30:25.743Z (3 months ago)
- Topics: couchdb, k8s, k8s-operator, mongodb, mssql, mysql, postgresql, sqlserver
- Language: Go
- Homepage:
- Size: 188 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/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:
```yaml
apiVersion: anbraten.github.io/v1alpha1
kind: Database
metadata:
name: guestbook-database
spec:
type: mongo
database: guestbook
username: guestbook-admin
password: iwonttellyou
```> Important note: :rotating_light: 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 :white_check_mark:
- couchdb :white_check_mark:
- mysql :white_check_mark:
- postgres :white_check_mark:
- mssql :white_check_mark:## Deployment
1. Adjust the secrets in `deploy/database-secrets.yml` to your needs.
1. Deploy them using: `kubectl apply -f deploy/database-secrets.yml`
1. 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:
```bash
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
```