Skip to content

Commit 08cc5e4

Browse files
committed
chore(cloudnative-pg): test restore to openebs-hostpath PVs (#567)
1 parent 1689464 commit 08cc5e4

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/postgresql.cnpg.io/cluster_v1.json
3+
apiVersion: postgresql.cnpg.io/v1
4+
kind: Cluster
5+
metadata:
6+
name: postgres16-v2
7+
spec:
8+
instances: 3 # set to the number of nodes in the cluster
9+
imageName: ghcr.io/cloudnative-pg/postgresql:16.1-8
10+
primaryUpdateStrategy: unsupervised
11+
storage:
12+
size: 10Gi
13+
storageClass: openebs-hostpath
14+
superuserSecret:
15+
name: cloudnative-pg
16+
enableSuperuserAccess: true
17+
nodeMaintenanceWindow:
18+
inProgress: false
19+
reusePVC: true
20+
resources:
21+
requests:
22+
memory: 800Mi
23+
cpu: 200m
24+
limits:
25+
memory: 2Gi
26+
monitoring:
27+
enablePodMonitor: true
28+
# Ref: https://github.com/cloudnative-pg/cloudnative-pg/issues/2501
29+
podMonitorMetricRelabelings:
30+
- sourceLabels:
31+
- cluster
32+
targetLabel: cnpg_cluster
33+
action: replace
34+
- regex: cluster
35+
action: labeldrop
36+
backup:
37+
retentionPolicy: 30d
38+
barmanObjectStore: &barmanObjectStore
39+
data:
40+
compression: bzip2
41+
wal:
42+
compression: bzip2
43+
maxParallel: 8
44+
destinationPath: s3://cloudnative-pg/
45+
endpointURL: https://s3.18b.haus
46+
# Note: serverName version needs to be inclemented
47+
# when recovering from an existing cnpg cluster
48+
serverName: &currentCluster postgres16-v2
49+
s3Credentials:
50+
accessKeyId:
51+
name: cloudnative-pg
52+
key: aws-access-key-id
53+
secretAccessKey:
54+
name: cloudnative-pg
55+
key: aws-secret-access-key
56+
# Note: previousCluster needs to be set to the name of the previous cluster
57+
# when recovering from an existing cnpg cluster
58+
bootstrap:
59+
recovery:
60+
source: &previousCluster postgres16
61+
# Note: externalClusters is needed when recovering from an existing cnpg
62+
# cluster
63+
externalClusters:
64+
- name: *previousCluster
65+
barmanObjectStore:
66+
<<: *barmanObjectStore
67+
serverName: *previousCluster

kubernetes/apps/database/cloudnative-pg/cluster/kustomization.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
resources:
66
- ./cluster16.yaml
7+
- ./cluster16-v2.yaml
78
- ./prometheusrule.yaml
89
- ./scheduledbackup.yaml

0 commit comments

Comments
 (0)