From bcd4a6a73a8cef52956eaf42ca8223f66dd30bc0 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sun, 10 Apr 2022 12:52:59 +0200
Subject: [PATCH] feat(nextcloud): Make postgresql HA

This patch introduces an override to make PostgreSQL HA by running more
than one instance managed by the postgresql-operator.

This is a first experiments with the HA features and might become a
blue-print for further experiments.
---
 apps/k8s01/nextcloud/database-override.yaml | 9 +++++++++
 apps/k8s01/nextcloud/kustomization.yaml     | 2 ++
 2 files changed, 11 insertions(+)
 create mode 100644 apps/k8s01/nextcloud/database-override.yaml

diff --git a/apps/k8s01/nextcloud/database-override.yaml b/apps/k8s01/nextcloud/database-override.yaml
new file mode 100644
index 000000000..22974bdce
--- /dev/null
+++ b/apps/k8s01/nextcloud/database-override.yaml
@@ -0,0 +1,9 @@
+apiVersion: "acid.zalan.do/v1"
+kind: postgresql
+metadata:
+  name: nextcloud-postgres
+  namespace: nextcloud
+spec:
+  numberOfInstances: 2
+  volume:
+    size: 1Gi
diff --git a/apps/k8s01/nextcloud/kustomization.yaml b/apps/k8s01/nextcloud/kustomization.yaml
index 36c1a5e6b..f7c10af7a 100644
--- a/apps/k8s01/nextcloud/kustomization.yaml
+++ b/apps/k8s01/nextcloud/kustomization.yaml
@@ -6,3 +6,5 @@ resources:
   - certificate.yaml
   - nextcloud-values.yaml
   - ../../../shared/resourcequotas/default.yaml
+patchesStrategicMerge:
+  - database-override.yaml
-- 
GitLab