From 3c011f91e2447ccccf503db9a91676fdd02f17fc Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Mon, 23 Dec 2024 18:33:35 -0600 Subject: [PATCH] add pg-17 --- .../cl01tl/applications/sonarr4-4k/Chart.yaml | 6 ++- .../sonarr4-4k/templates/external-secret.yaml | 32 +++++++++++++++ .../applications/sonarr4-4k/values.yaml | 41 ++++++++++++++++++- .../cl01tl/applications/sonarr4/Chart.yaml | 6 ++- .../sonarr4/templates/external-secret.yaml | 32 +++++++++++++++ .../cl01tl/applications/sonarr4/values.yaml | 40 ++++++++++++++++++ 6 files changed, 154 insertions(+), 3 deletions(-) diff --git a/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml b/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml index e97618f18..300d97f59 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml @@ -26,7 +26,11 @@ dependencies: version: 3.5.1 - name: postgres-cluster alias: postgres-16-cluster - version: 3.19.0 + version: 3.21.0 repository: http://alexlebens.github.io/helm-charts + - name: postgres-cluster + alias: postgres-17-cluster + version: 3.21.0 + repository: http://alexlebens.github.io/helm-charts icon: https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/sonarr.png appVersion: 4.0.11.2680 diff --git a/clusters/cl01tl/applications/sonarr4-4k/templates/external-secret.yaml b/clusters/cl01tl/applications/sonarr4-4k/templates/external-secret.yaml index e79ebf62c..64cc0208f 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/templates/external-secret.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/templates/external-secret.yaml @@ -87,3 +87,35 @@ spec: key: /digital-ocean/home-infra/postgres-backups metadataPolicy: None property: secret + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: sonarr4-4k-postgresql-17-cluster-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4-4k-postgresql-17-cluster-backup-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: ACCESS_KEY_ID + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: access + - secretKey: ACCESS_SECRET_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: secret diff --git a/clusters/cl01tl/applications/sonarr4-4k/values.yaml b/clusters/cl01tl/applications/sonarr4-4k/values.yaml index e1d89f8d0..477024efd 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/values.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/values.yaml @@ -144,6 +144,7 @@ sonarr4-4k: postgres-16-cluster: mode: standalone cluster: + enableSuperuserAccess: true walStorage: storageClass: local-path storage: @@ -162,4 +163,42 @@ postgres-16-cluster: destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/sonarr4-4k/sonarr4-4k-postgresql-16-cluster endpointCredentials: sonarr4-4k-postgresql-16-cluster-backup-secret backupIndex: 1 - retentionPolicy: "7d" + retentionPolicy: "7d" +postgres-17-cluster: + mode: replica + cluster: + image: + repository: ghcr.io/cloudnative-pg/postgresql + tag: "17.2-22" + walStorage: + storageClass: local-path + storage: + storageClass: local-path + monitoring: + enabled: true + bootstrap: + initdb: + database: app + owner: app + postInitSQL: + - CREATE DATABASE "sonarr-main" OWNER "app"; + - CREATE DATABASE "sonarr-log" OWNER "app"; + replica: + importType: monolith + importDatabases: + - app + externalCluster: + connectionParameters: + host: sonarr4-4k-postgresql-16-cluster-rw + user: postgres + dbname: postgres + password: + name: sonarr4-4k-postgresql-16-cluster-superuser + key: password + backup: + enabled: false + endpointURL: https://nyc3.digitaloceanspaces.com + destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/sonarr4-4k/sonarr4-4k-postgresql-17-cluster + endpointCredentials: sonarr4-4k-postgresql-17-cluster-backup-secret + backupIndex: 1 + retentionPolicy: "7d" diff --git a/clusters/cl01tl/applications/sonarr4/Chart.yaml b/clusters/cl01tl/applications/sonarr4/Chart.yaml index bdc1064d0..63c47bbc1 100644 --- a/clusters/cl01tl/applications/sonarr4/Chart.yaml +++ b/clusters/cl01tl/applications/sonarr4/Chart.yaml @@ -25,7 +25,11 @@ dependencies: version: 3.5.1 - name: postgres-cluster alias: postgres-16-cluster - version: 3.19.0 + version: 3.21.0 + repository: http://alexlebens.github.io/helm-charts + - name: postgres-cluster + alias: postgres-17-cluster + version: 3.21.0 repository: http://alexlebens.github.io/helm-charts icon: https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/sonarr.png appVersion: 4.0.11.2680 diff --git a/clusters/cl01tl/applications/sonarr4/templates/external-secret.yaml b/clusters/cl01tl/applications/sonarr4/templates/external-secret.yaml index 3e4fd152f..cdb47b4e1 100644 --- a/clusters/cl01tl/applications/sonarr4/templates/external-secret.yaml +++ b/clusters/cl01tl/applications/sonarr4/templates/external-secret.yaml @@ -87,3 +87,35 @@ spec: key: /digital-ocean/home-infra/postgres-backups metadataPolicy: None property: secret + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: sonarr4-postgresql-17-cluster-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4-postgresql-17-cluster-backup-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: ACCESS_KEY_ID + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: access + - secretKey: ACCESS_SECRET_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: secret diff --git a/clusters/cl01tl/applications/sonarr4/values.yaml b/clusters/cl01tl/applications/sonarr4/values.yaml index 25fa7ef45..5ebf842f7 100644 --- a/clusters/cl01tl/applications/sonarr4/values.yaml +++ b/clusters/cl01tl/applications/sonarr4/values.yaml @@ -144,6 +144,7 @@ sonarr4: postgres-16-cluster: mode: standalone cluster: + enableSuperuserAccess: true walStorage: storageClass: local-path storage: @@ -163,3 +164,42 @@ postgres-16-cluster: endpointCredentials: sonarr4-postgresql-16-cluster-backup-secret backupIndex: 1 retentionPolicy: "7d" +postgres-17-cluster: + mode: replica + cluster: + image: + repository: ghcr.io/cloudnative-pg/postgresql + tag: "17.2-22" + walStorage: + storageClass: local-path + storage: + storageClass: local-path + monitoring: + enabled: true + bootstrap: + initdb: + database: app + owner: app + postInitSQL: + - CREATE DATABASE "sonarr-main" OWNER "app"; + - CREATE DATABASE "sonarr-log" OWNER "app"; + replica: + importType: monolith + importDatabases: + - sonarr-main + - sonarr-log + externalCluster: + connectionParameters: + host: sonarr4-postgresql-16-cluster-rw + user: postgres + dbname: postgres + password: + name: sonarr4-postgresql-16-cluster-superuser + key: password + backup: + enabled: false + endpointURL: https://nyc3.digitaloceanspaces.com + destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/sonarr4/sonarr4-postgresql-17-cluster + endpointCredentials: sonarr4-postgresql-17-cluster-backup-secret + backupIndex: 1 + retentionPolicy: "7d"