From be04dbf34dcd7e8ef6ca9a699b8b0c96311bfa75 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Wed, 29 Nov 2023 09:20:39 +0800 Subject: [PATCH] feat: deploy per-app Crunchy Postgres clusters --- kube/deploy/apps/atuin/ks.yaml | 8 ++++---- kube/deploy/apps/firefly/ks.yaml | 5 +++-- kube/deploy/apps/joplin/ks.yaml | 21 +++++++++++++++++++++ kube/deploy/apps/miniflux/ks.yaml | 21 +++++++++++++++++++++ kube/deploy/apps/piped/ks.yaml | 23 ++++++++++++++++++++++- kube/deploy/apps/soft-serve/ks.yaml | 21 +++++++++++++++++++++ kube/deploy/apps/zipline/ks.yaml | 8 ++++---- 7 files changed, 96 insertions(+), 11 deletions(-) diff --git a/kube/deploy/apps/atuin/ks.yaml b/kube/deploy/apps/atuin/ks.yaml index 8609edee..e67a6181 100644 --- a/kube/deploy/apps/atuin/ks.yaml +++ b/kube/deploy/apps/atuin/ks.yaml @@ -19,14 +19,14 @@ spec: path: ./kube/deploy/core/db/pg/clusters/template dependsOn: - name: 1-core-db-pg-app - - name: 1-core-storage-rook-ceph-cluster + - name: 1-core-storage-democratic-csi-local-hostpath postBuild: substitute: PG_APP_NAME: &app "atuin" PG_APP_NS: *app PG_DB_NAME: *app PG_DB_USER: *app - PG_REPLICAS: "2" - PG_SC: "block" + PG_REPLICAS: "3" + PG_SC: "local" PG_CONFIG_VERSION: "15.2-11" - PG_CONFIG_SIZE: "20Gi" \ No newline at end of file + PG_CONFIG_SIZE: "20Gi" diff --git a/kube/deploy/apps/firefly/ks.yaml b/kube/deploy/apps/firefly/ks.yaml index 7a5aea10..66036332 100644 --- a/kube/deploy/apps/firefly/ks.yaml +++ b/kube/deploy/apps/firefly/ks.yaml @@ -21,6 +21,7 @@ spec: path: ./kube/deploy/core/db/pg/clusters/template dependsOn: - name: 1-core-db-pg-app + - name: 1-core-storage-democratic-csi-local-hostpath postBuild: substitute: PG_APP_NAME: &app "firefly" @@ -28,7 +29,7 @@ spec: PG_DB_NAME: *app PG_DB_USER: *app PG_REPLICAS: "3" - PG_SC: "block" + PG_SC: "local" PG_CONFIG_VERSION: "15.2-11" PG_CONFIG_SIZE: "20Gi" # healthChecks: @@ -39,4 +40,4 @@ spec: # - name: pg-firefly # namespace: firefly # kind: Cluster - # apiVersion: postgresql.cnpg.io/v1 \ No newline at end of file + # apiVersion: postgresql.cnpg.io/v1 diff --git a/kube/deploy/apps/joplin/ks.yaml b/kube/deploy/apps/joplin/ks.yaml index f4cf4f07..2d5221a0 100644 --- a/kube/deploy/apps/joplin/ks.yaml +++ b/kube/deploy/apps/joplin/ks.yaml @@ -9,3 +9,24 @@ spec: dependsOn: # - name: 1-core-db-pg-clusters-default - name: 1-core-ingress-nginx-app +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: joplin-db + namespace: flux-system +spec: + path: ./kube/deploy/core/db/pg/clusters/template + dependsOn: + - name: 1-core-db-pg-app + - name: 1-core-storage-democratic-csi-local-hostpath + postBuild: + substitute: + PG_APP_NAME: &app "joplin" + PG_APP_NS: *app + PG_DB_NAME: *app + PG_DB_USER: *app + PG_REPLICAS: "3" + PG_SC: "local" + PG_CONFIG_VERSION: "15.2-11" + PG_CONFIG_SIZE: "20Gi" diff --git a/kube/deploy/apps/miniflux/ks.yaml b/kube/deploy/apps/miniflux/ks.yaml index 49843dae..3547f714 100644 --- a/kube/deploy/apps/miniflux/ks.yaml +++ b/kube/deploy/apps/miniflux/ks.yaml @@ -11,3 +11,24 @@ spec: dependsOn: - name: 1-core-ingress-nginx-app - name: 1-core-db-pg-clusters-default +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: miniflux-db + namespace: flux-system +spec: + path: ./kube/deploy/core/db/pg/clusters/template + dependsOn: + - name: 1-core-db-pg-app + - name: 1-core-storage-democratic-csi-local-hostpath + postBuild: + substitute: + PG_APP_NAME: &app "miniflux" + PG_APP_NS: *app + PG_DB_NAME: *app + PG_DB_USER: *app + PG_REPLICAS: "3" + PG_SC: "local" + PG_CONFIG_VERSION: "15.2-11" + PG_CONFIG_SIZE: "20Gi" diff --git a/kube/deploy/apps/piped/ks.yaml b/kube/deploy/apps/piped/ks.yaml index 56268027..f67173af 100644 --- a/kube/deploy/apps/piped/ks.yaml +++ b/kube/deploy/apps/piped/ks.yaml @@ -8,4 +8,25 @@ spec: path: ./kube/deploy/apps/piped/app dependsOn: - name: 1-core-ingress-nginx-app - - name: 1-core-db-pg-clusters-default \ No newline at end of file + - name: 1-core-db-pg-clusters-default +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: piped-db + namespace: flux-system +spec: + path: ./kube/deploy/core/db/pg/clusters/template + dependsOn: + - name: 1-core-db-pg-app + - name: 1-core-storage-democratic-csi-local-hostpath + postBuild: + substitute: + PG_APP_NAME: &app "piped" + PG_APP_NS: *app + PG_DB_NAME: *app + PG_DB_USER: *app + PG_REPLICAS: "3" + PG_SC: "local" + PG_CONFIG_VERSION: "15.2-11" + PG_CONFIG_SIZE: "20Gi" diff --git a/kube/deploy/apps/soft-serve/ks.yaml b/kube/deploy/apps/soft-serve/ks.yaml index 49c817c4..e7f793de 100644 --- a/kube/deploy/apps/soft-serve/ks.yaml +++ b/kube/deploy/apps/soft-serve/ks.yaml @@ -13,3 +13,24 @@ spec: # - name: 1-core-db-pg-clusters-default - name: 1-core-ingress-nginx-app #- name: 1-core-storage-volsync-app +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: soft-serve-db + namespace: flux-system +spec: + path: ./kube/deploy/core/db/pg/clusters/template + dependsOn: + - name: 1-core-db-pg-app + - name: 1-core-storage-democratic-csi-local-hostpath + postBuild: + substitute: + PG_APP_NAME: &app "soft-serve" + PG_APP_NS: *app + PG_DB_NAME: *app + PG_DB_USER: *app + PG_REPLICAS: "3" + PG_SC: "local" + PG_CONFIG_VERSION: "15.2-11" + PG_CONFIG_SIZE: "20Gi" diff --git a/kube/deploy/apps/zipline/ks.yaml b/kube/deploy/apps/zipline/ks.yaml index 03f59f85..f5cb3acc 100644 --- a/kube/deploy/apps/zipline/ks.yaml +++ b/kube/deploy/apps/zipline/ks.yaml @@ -18,14 +18,14 @@ spec: path: ./kube/deploy/core/db/pg/clusters/template dependsOn: - name: 1-core-db-pg-app - - name: 1-core-storage-rook-ceph-cluster + - name: 1-core-storage-democratic-csi-local-hostpath postBuild: substitute: PG_APP_NAME: &app "zipline" PG_APP_NS: *app PG_DB_NAME: *app PG_DB_USER: *app - PG_REPLICAS: "2" - PG_SC: "block" + PG_REPLICAS: "3" + PG_SC: "local" PG_CONFIG_VERSION: "15.2-11" - PG_CONFIG_SIZE: "10Gi" \ No newline at end of file + PG_CONFIG_SIZE: "10Gi"