From 764b28110806be1458cac43f02990c8af1166273 Mon Sep 17 00:00:00 2001 From: nold Date: Tue, 13 Dec 2022 21:18:42 +0100 Subject: [PATCH] add(hass|nextcloud): postgresql --- projects/homeassistant/manifests/postgre.yaml | 42 ++++++++++++++ projects/nextcloud/manifests/postgre.yaml | 57 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 projects/homeassistant/manifests/postgre.yaml create mode 100644 projects/nextcloud/manifests/postgre.yaml diff --git a/projects/homeassistant/manifests/postgre.yaml b/projects/homeassistant/manifests/postgre.yaml new file mode 100644 index 00000000..0b3492d4 --- /dev/null +++ b/projects/homeassistant/manifests/postgre.yaml @@ -0,0 +1,42 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: homeassistant + namespace: homeassistant +spec: + instances: 1 + imageName: ghcr.io/cloudnative-pg/postgresql:15 + + bootstrap: + initdb: + import: + type: microservice + databases: + - homeassistant + source: + externalCluster: homeassistant + + backup: + barmanObjectStore: + destinationPath: "s3://homeassistant-db/" + endpointURL: "http://minio.minio.svc.cluster.local:9000" + s3Credentials: + accessKeyId: + name: bucket + key: accesskey + secretAccessKey: + name: bucket + key: secretkey + + storage: + size: 10Gi + + externalClusters: + - name: homeassistant + connectionParameters: + host: homeassistant-postgresql.homeassistant.svc.cluster.local + user: homeassistant + dbname: nextcloud + password: + name: hass-postgres + key: postgresql-password diff --git a/projects/nextcloud/manifests/postgre.yaml b/projects/nextcloud/manifests/postgre.yaml new file mode 100644 index 00000000..3d92bd29 --- /dev/null +++ b/projects/nextcloud/manifests/postgre.yaml @@ -0,0 +1,57 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: nextcloud-db + namespace: nextcloud +spec: + instances: 1 + imageName: ghcr.io/cloudnative-pg/postgresql:15 + + bootstrap: + initdb: + import: + type: microservice + databases: + - nextcloud + source: + externalCluster: nextcloud + + backup: + barmanObjectStore: + destinationPath: "s3://nextcloud-db/" + endpointURL: "http://minio.minio.svc.cluster.local:9000" + s3Credentials: + accessKeyId: + name: bucket + key: accesskey + secretAccessKey: + name: bucket + key: secretkey + wal: + compression: gzip + #encryption: AES256 + data: + compression: gzip + #encryption: AES256 + retentionPolicy: "90d" + + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "1Gi" + cpu: "1" + + storage: + size: 10Gi + + externalClusters: + - name: nextcloud + connectionParameters: + host: nextcloud-postgresql.nextcloud.svc.cluster.local + user: nextcloud + dbname: nextcloud + password: + name: nextcloud-postgres + key: postgresql-password