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