{"id":23655798,"url":"https://github.com/datenhahn/simple-database-provisioner","last_synced_at":"2026-02-13T15:08:56.459Z","repository":{"id":64307335,"uuid":"164155766","full_name":"datenhahn/simple-database-provisioner","owner":"datenhahn","description":"The simple database provisioner allows to create and remove databases and user credentials (secretes) via kubernetes ressources on an existing DBMS server.","archived":false,"fork":false,"pushed_at":"2019-05-16T07:39:43.000Z","size":14467,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T07:19:05.383Z","etag":null,"topics":["dbms","k8s","kubernetes","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datenhahn.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-04T21:19:01.000Z","updated_at":"2023-10-06T16:56:05.000Z","dependencies_parsed_at":"2023-01-15T11:00:56.396Z","dependency_job_id":null,"html_url":"https://github.com/datenhahn/simple-database-provisioner","commit_stats":null,"previous_names":["datenhahn/simple-database-provisioner","ecodia/simple-database-provisioner"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/datenhahn/simple-database-provisioner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fsimple-database-provisioner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fsimple-database-provisioner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fsimple-database-provisioner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fsimple-database-provisioner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datenhahn","download_url":"https://codeload.github.com/datenhahn/simple-database-provisioner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fsimple-database-provisioner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29411138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbms","k8s","kubernetes","postgresql"],"created_at":"2024-12-28T20:15:52.641Z","updated_at":"2026-02-13T15:08:56.439Z","avatar_url":"https://github.com/datenhahn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Kubernetes Simple Database Provisioner\n:toc:\n\n[link=http://www.apache.org/licenses/LICENSE-2.0.txt]\nimage::.images/license-apache.svg[License: Apache License 2.0]\n\nimage::.images/simple-database-provisioner.svg[alt=Simple Database Provisioner,width=200]\n\n\n\nThe simple database provisioner allows to create and remove databases and user credentials (secretes) via\nkubernetes ressources on an existing DBMS server.\n\nIt was created as a simpler and more resilient alternative to setting up databases with OSBA.\n\n== Status\n\n**CURRENT STATUS: ALPHA**\n\nNot intended for production use yet. Tests, refactoring\nand updating the documentation are missing.\n\n\n== Concept\n\n* DBMS servers have to be created by some other tool (e.g. manually, or terraform)\n* DBMS servers are identified in the config via a unique name and a secret with\n  the connection information\n* DBMS management is (currently) static and requires a pod restart\n* Database Instance and Binding management is dynamic via two Custom Resource Definitions\n\n== Installation\n\nThere is a helm chart provided so you can easily install it in your\ncluster.\n\n1. Set up a postgres database server manually somehow and have the\n   credentials ready. The user must be able to create databases and\n   roles.\n2. Create a secret with these credentials. (all values are base64\n   encoded, as usual). See `examples/dev-postgres-secret.yaml` for\n   an example kubernetes resource definition. The **metadata -\u003e name**\n   will be the identifier with which you can later assign some databases\n   onto that dbms server.\n3. Enter the directory `helm/simple-database-provisioner` and execute\n\n     helm -n sdp sync --name \"simple-database-provisioner\" .\n\n\nNow watch the logs and create/delete some resources (e.g. from the `examples` folder, to verify functionality and to get used to it.\n\n== Configuration\n\n=== Application Config File\n\n**config.yaml**\n```yaml\n\ndbmsServers:\n  dev-postgres:\n    secret: dev-postgres-secret\n\npersistence:\n  type: file\n  location: ./sdp.db.yaml\n```\n\n=== Database Format (DRAFT)\n\nThe database format currently is only a rough draft and might\nchange during development according to the needs (e.g. list instead\nof map, etc.).\n\n\n```yaml\n\nnamespaces:\n  master:\n    instances:\n      mynamespace-myservice-database:\n        dbmsServer: dev-postgres\n        databaseName: mynamespace-myservice\n    bindings:\n      mynamespace-myservice-binding:\n        instanceName: mynamespace-myservice-database\n        secretName: mynamespace-myservice-database-secret\n\n```\n\n=== DBMS Secret\n\n```yaml\napiVersion: v1\nkind: Secret\ntype: Opaque\nmetadata:\n  name: dbms-dev-postgres-secret\ndata:\n  database: cG9zdGdyZXM=\n  host: cG9zdGdyZXMtcG9zdGdyZXNxbA==\n  password: WkthNWE4Y0w0Yg==\n  port: NTQzMg==\n  ssl: ZmFsc2U=\n  user: cG9zdGdyZXM=\n```\n\n== Custom Resource Definitions\n\n==== CDR: SimpleDatabaseInstance\n\n```yaml\napiVersion: apiextensions.k8s.io/v1beta1\nkind: CustomResourceDefinition\nmetadata:\n  name: simpledatabaseinstances.simpledatabaseprovisioner.k8s.ecodia.de\nspec:\n  group: simpledatabaseprovisioner.k8s.ecodia.de\n  version: v1alpha1\n  scope: Namespaced\n  conditions:\n  stored_versions: []\n  names:\n    plural: simpledatabaseinstances\n    singular: simpledatabaseinstance\n    kind: SimpleDatabaseInstance\n    shortNames:\n     - sdi\n```\n\n**Example**\n\n```yaml\napiVersion: simpledatabaseprovisioner.k8s.ecodia.de/v1alpha1\nkind: SimpleDatabaseInstance\nmetadata:\n  name: sample-application-database\nspec:\n  dbmsServer: dbms-dev-postgres\n  databaseName: sample-application-database\n```\n\n==== CDR: SimpleDatabaseBinding\n\n```yaml\napiVersion: apiextensions.k8s.io/v1beta1\nkind: CustomResourceDefinition\nmetadata:\n  name: simpledatabasebindings.simpledatabaseprovisioner.k8s.ecodia.de\nspec:\n  group: simpledatabaseprovisioner.k8s.ecodia.de\n  version: v1alpha1\n  scope: Namespaced\n  names:\n    plural: simpledatabasebindings\n    singular: simpledatabasebinding\n    kind: SimpleDatabaseBinding\n    shortNames:\n     - sdb\n```\n\n**Example**\n\n```yaml\napiVersion: simpledatabaseprovisioner.k8s.ecodia.de/v1alpha1\nkind: SimpleDatabaseBinding\nmetadata:\n  name: sample-application-binding\nspec:\n  instanceName: sample-application-database\n  secretName: sample-application-database-secret\n```\n\n== Development\n\nThis controller is based on the kubernetes samplecontroller:\n\nhttps://github.com/kubernetes/sample-controller\n\n\n=== Hands on\n\nLet's jump right into some hands on commands\n\n==== Run the controller\n\n* The controller automatically detects if it is run inside a\n  cluster or can connect to a cluster via the kubernetes api\n\n* start minikube\n\n* run controller.py , then load the example resources and watch\n  how events are read\n\n   kubectl apply -f examples/sdi-example.yaml\n   kubectl apply -f examples/sdb-example.yaml\n\n==== Delete databases and bindings\n\nFor testing purposes it might be necessary to remove the instances and bindings:\n\n   kubectl delete sdi/sample-application-database\n   kubectl delete sdb/sample-application-binding\n\n\n==== Delete Custom Resource Definitions\n\nFor testing purposes it might be necessary to remove the custom resource definitions:\n\n    kubectl delete crd/simpledatabasebindings.simpledatabaseprovisioner.k8s.ecodia.de\n    kubectl delete crd/simpledatabaseinstances.simpledatabaseprovisioner.k8s.ecodia.de\n\n=== Run tests\n\nTo run the tests you need minikube and a postgres database\nwith the correct user credentials:\n\n    minikube start\n    docker run --rm --name sdp-postgres-testdb -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres postgres\n\nThen start the tests with:\n    go test simple-database-provisioner...\n\n=== Generate custom resource types\n\nThe simple-database-provisioner controller is based on https://github.com/kubernetes/sample-controller .\n\nIt makes use of the generators in k8s.io/code-generator to generate a typed client, informers, listers and deep-copy functions. You can do this yourself using the ./hack/update-codegen.sh script.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fsimple-database-provisioner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatenhahn%2Fsimple-database-provisioner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fsimple-database-provisioner/lists"}