initial commit
This commit is contained in:
8
odroid/cnpg/postgres13/backup.yaml
Normal file
8
odroid/cnpg/postgres13/backup.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Backup
|
||||
metadata:
|
||||
name: postgres13-backup
|
||||
namespace: postgres
|
||||
spec:
|
||||
cluster:
|
||||
name: postgres13
|
||||
50
odroid/cnpg/postgres13/create.yaml
Normal file
50
odroid/cnpg/postgres13/create.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
spec:
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:13.14-3
|
||||
instances: 3
|
||||
superuserSecret:
|
||||
name: superuser-secret
|
||||
bootstrap:
|
||||
initdb:
|
||||
postInitSQL:
|
||||
- CREATE USER admin WITH PASSWORD 'Postgres01@'
|
||||
- ALTER USER admin WITH SUPERUSER
|
||||
- CREATE USER harbor WITH PASSWORD 'harbor'
|
||||
- CREATE DATABASE harbor OWNER harbor
|
||||
storage:
|
||||
size: 5Gi
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
|
||||
backup:
|
||||
barmanObjectStore:
|
||||
destinationPath: 's3://backups/'
|
||||
endpointURL: 'http://minio.postgres:9000'
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: minio-creds
|
||||
key: MINIO_ACCESS_KEY
|
||||
secretAccessKey:
|
||||
name: minio-creds
|
||||
key: MINIO_SECRET_KEY
|
||||
retentionPolicy: "1d"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres13-lb
|
||||
namespace: postgres
|
||||
spec:
|
||||
selector:
|
||||
cnpg.io/cluster: postgres13
|
||||
role: primary
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
type: LoadBalancer
|
||||
|
||||
46
odroid/cnpg/postgres13/recover1.yaml
Normal file
46
odroid/cnpg/postgres13/recover1.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: postgres13-1
|
||||
namespace: postgres
|
||||
spec:
|
||||
instances: 3
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:13.14-3
|
||||
|
||||
superuserSecret:
|
||||
name: superuser-secret
|
||||
|
||||
storage:
|
||||
size: 5Gi
|
||||
storageClass: nfs-client
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
|
||||
backup:
|
||||
barmanObjectStore:
|
||||
destinationPath: 's3://backups/'
|
||||
endpointURL: 'http://minio.postgres:9000'
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: minio-creds
|
||||
key: MINIO_ACCESS_KEY
|
||||
secretAccessKey:
|
||||
name: minio-creds
|
||||
key: MINIO_SECRET_KEY
|
||||
retentionPolicy: "1d"
|
||||
bootstrap:
|
||||
recovery:
|
||||
source: postgres13
|
||||
externalClusters:
|
||||
- name: postgres13
|
||||
barmanObjectStore:
|
||||
destinationPath: 's3://backups/'
|
||||
endpointURL: 'http://minio.postgres:9000'
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: minio-creds
|
||||
key: MINIO_ACCESS_KEY
|
||||
secretAccessKey:
|
||||
name: minio-creds
|
||||
key: MINIO_SECRET_KEY
|
||||
46
odroid/cnpg/postgres13/recover2.yaml
Normal file
46
odroid/cnpg/postgres13/recover2.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
spec:
|
||||
instances: 3
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:13.14-3
|
||||
|
||||
superuserSecret:
|
||||
name: superuser-secret
|
||||
|
||||
storage:
|
||||
size: 5Gi
|
||||
storageClass: nfs-client
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
|
||||
backup:
|
||||
barmanObjectStore:
|
||||
destinationPath: 's3://backups/'
|
||||
endpointURL: 'http://minio.postgres:9000'
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: minio-creds
|
||||
key: MINIO_ACCESS_KEY
|
||||
secretAccessKey:
|
||||
name: minio-creds
|
||||
key: MINIO_SECRET_KEY
|
||||
retentionPolicy: "1d"
|
||||
bootstrap:
|
||||
recovery:
|
||||
source: postgres13-1
|
||||
externalClusters:
|
||||
- name: postgres13-1
|
||||
barmanObjectStore:
|
||||
destinationPath: 's3://backups/'
|
||||
endpointURL: 'http://minio.postgres:9000'
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
name: minio-creds
|
||||
key: MINIO_ACCESS_KEY
|
||||
secretAccessKey:
|
||||
name: minio-creds
|
||||
key: MINIO_SECRET_KEY
|
||||
9
odroid/cnpg/postgres13/schedulebackup.yaml
Normal file
9
odroid/cnpg/postgres13/schedulebackup.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: ScheduledBackup
|
||||
metadata:
|
||||
name: postgres13-backup
|
||||
spec:
|
||||
schedule: "0 0 14 * * *"
|
||||
backupOwnerReference: self
|
||||
cluster:
|
||||
name: postgres13
|
||||
Reference in New Issue
Block a user