Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-enabling cnpg and restoring form backup #58

Merged
merged 2 commits into from
Jan 13, 2024
Merged

re-enabling cnpg and restoring form backup #58

merged 2 commits into from
Jan 13, 2024

Conversation

gavinmcfall
Copy link
Owner

No description provided.

Copy link

--- kubernetes/apps/database/cloudnative-pg/cluster Kustomization: flux-system/cloudnative-pg-cluster Cluster: database/postgres16

+++ kubernetes/apps/database/cloudnative-pg/cluster Kustomization: flux-system/cloudnative-pg-cluster Cluster: database/postgres16

@@ -19,18 +19,36 @@

         accessKeyId:
           key: aws-access-key-id
           name: cloudnative-pg-secret
         secretAccessKey:
           key: aws-secret-access-key
           name: cloudnative-pg-secret
-      serverName: postgres16-v2
+      serverName: postgres16-v3
       wal:
         compression: bzip2
         maxParallel: 8
     retentionPolicy: 30d
+  bootstrap:
+    recovery:
+      source: postgres16-v2
   enableSuperuserAccess: true
+  externalClusters:
+  - barmanObjectStore:
+      destinationPath: s3://nerdz-cloudnative-pg/
+      endpointURL: https://s3.us-east-005.backblazeb2.com
+      s3Credentials:
+        accessKeyId:
+          key: aws-access-key-id
+          name: cloudnative-pg-secret
+        secretAccessKey:
+          key: aws-secret-access-key
+          name: cloudnative-pg-secret
+      wal:
+        compression: bzip2
+        maxParallel: 8
+    name: postgres16-v2
   imageName: ghcr.io/cloudnative-pg/postgresql:16.1-12
   instances: 3
   monitoring:
     enablePodMonitor: true
     podMonitorMetricRelabelings:
     - action: replace
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg

@@ -0,0 +1,40 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: cloudnative-pg
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: cloudnative-pg
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  dependsOn:
+  - name: external-secrets-stores
+  interval: 30m
+  path: ./kubernetes/apps/database/cloudnative-pg/app
+  postBuild:
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+    - kind: ConfigMap
+      name: cluster-settings-user
+    - kind: Secret
+      name: cluster-secrets-user
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: database
+  timeout: 5m
+  wait: true
+
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg-cluster

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg-cluster

@@ -0,0 +1,46 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: cloudnative-pg-cluster
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: cloudnative-pg-cluster
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  dependsOn:
+  - name: cloudnative-pg
+  - name: external-secrets-stores
+  interval: 30m
+  path: ./kubernetes/apps/database/cloudnative-pg/cluster
+  postBuild:
+    substitute:
+      APP: cloudnative-pg-cluster
+      GATUS_NAMESPACE: database
+      GATUS_SVC_NAME: postgres-lb
+      GATUS_SVC_PORT: '5432'
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+    - kind: ConfigMap
+      name: cluster-settings-user
+    - kind: Secret
+      name: cluster-secrets-user
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: database
+  timeout: 5m
+  wait: true
+

@gavinmcfall gavinmcfall merged commit 5f88b91 into main Jan 13, 2024
3 checks passed
@gavinmcfall gavinmcfall deleted the cnpg-01 branch January 13, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant