From 7c29ecf46d66d9d97d57f383c142292833c4114a Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Fri, 16 Aug 2024 13:29:36 +0200 Subject: [PATCH] feat(zipline): provision new DB --- zipline/kustomization.yaml | 2 ++ zipline/resources/db/db.yaml | 8 ++++++++ zipline/resources/db/user.yaml | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 zipline/resources/db/db.yaml create mode 100644 zipline/resources/db/user.yaml diff --git a/zipline/kustomization.yaml b/zipline/kustomization.yaml index c3ecbcb..96ce327 100644 --- a/zipline/kustomization.yaml +++ b/zipline/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_route.yaml" diff --git a/zipline/resources/db/db.yaml b/zipline/resources/db/db.yaml new file mode 100644 index 0000000..07768ed --- /dev/null +++ b/zipline/resources/db/db.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: Postgres +metadata: + name: zipline +spec: + database: zipline + dropOnDelete: false \ No newline at end of file diff --git a/zipline/resources/db/user.yaml b/zipline/resources/db/user.yaml new file mode 100644 index 0000000..7fa2e79 --- /dev/null +++ b/zipline/resources/db/user.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: db.movetokube.com/v1alpha1 +kind: PostgresUser +metadata: + name: zipline +spec: + role: zipline + database: zipline + 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