From 1e612bc89d4df5d13989365320289d9d9dec8994 Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Thu, 15 Aug 2024 15:06:37 +0200 Subject: [PATCH] feat(hedgedoc): provision new DB --- hedgedoc/kustomization.yaml | 2 ++ hedgedoc/resources/db/db.yaml | 8 ++++++++ hedgedoc/resources/db/user.yaml | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 hedgedoc/resources/db/db.yaml create mode 100644 hedgedoc/resources/db/user.yaml diff --git a/hedgedoc/kustomization.yaml b/hedgedoc/kustomization.yaml index c8c904c..8830ce8 100644 --- a/hedgedoc/kustomization.yaml +++ b/hedgedoc/kustomization.yaml @@ -16,6 +16,8 @@ labels: resources: - "resources/namespace.yaml" + - "resources/db/db.yaml" + - "resources/db/user.yaml" - "resources/deployment.yaml" - "resources/service.yaml" - "resources/http_routes.yaml" diff --git a/hedgedoc/resources/db/db.yaml b/hedgedoc/resources/db/db.yaml new file mode 100644 index 0000000..29b44f0 --- /dev/null +++ b/hedgedoc/resources/db/db.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: Postgres +metadata: + name: hedgedoc +spec: + database: hedgedoc + dropOnDelete: false \ No newline at end of file diff --git a/hedgedoc/resources/db/user.yaml b/hedgedoc/resources/db/user.yaml new file mode 100644 index 0000000..ea9144f --- /dev/null +++ b/hedgedoc/resources/db/user.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: PostgresUser +metadata: + name: hedgedoc +spec: + role: hedgedoc + database: hedgedoc + secretName: db-credentials + privileges: OWNER + secretTemplate: + PQ_URL: "postgresql://{{.Role}}:{{.Password}}@app-cluster-pooler-rw.postgres.svc:5432/{{.Database}}?sslmode=require" \ No newline at end of file