-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logical backup/restore process for PG
Signed-off-by: Anisur Rahman <[email protected]>
- Loading branch information
1 parent
4778ea1
commit 33c294a
Showing
54 changed files
with
1,065 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Backup & Restore PostgreSQL | KubeStash | ||
menu: | ||
docs_{{ .version }}: | ||
identifier: guides-pg-backup-stashv2 | ||
name: KubeStash (aka Stash 2.0) | ||
parent: guides-pg-backup | ||
weight: 40 | ||
menu_name: docs_{{ .version }} | ||
--- |
36 changes: 36 additions & 0 deletions
36
docs/guides/postgres/backup/kubestash/logical/examples/backupconfiguration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: core.kubestash.com/v1alpha1 | ||
kind: BackupConfiguration | ||
metadata: | ||
name: sample-postgres-backup | ||
namespace: demo | ||
spec: | ||
target: | ||
apiGroup: kubedb.com | ||
kind: Postgres | ||
namespace: demo | ||
name: sample-postgres | ||
backends: | ||
- name: gcs-backend | ||
storageRef: | ||
namespace: demo | ||
name: gcs-storage | ||
retentionPolicy: | ||
name: demo-retention | ||
namespace: demo | ||
sessions: | ||
- name: frequent-backup | ||
scheduler: | ||
schedule: "*/5 * * * *" | ||
jobTemplate: | ||
backoffLimit: 1 | ||
repositories: | ||
- name: gcs-postgres-repo | ||
backend: gcs-backend | ||
directory: /postgres | ||
encryptionSecret: | ||
name: encrypt-secret | ||
namespace: demo | ||
addon: | ||
name: postgres-addon | ||
tasks: | ||
- name: logical-backup |
17 changes: 17 additions & 0 deletions
17
docs/guides/postgres/backup/kubestash/logical/examples/backupstorage.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: storage.kubestash.com/v1alpha1 | ||
kind: BackupStorage | ||
metadata: | ||
name: gcs-storage | ||
namespace: demo | ||
spec: | ||
storage: | ||
provider: gcs | ||
gcs: | ||
bucket: kubestash-qa | ||
prefix: demo | ||
secretName: gcs-secret | ||
usagePolicy: | ||
allowedNamespaces: | ||
from: All | ||
default: true | ||
deletionPolicy: WipeOut |
20 changes: 20 additions & 0 deletions
20
docs/guides/postgres/backup/kubestash/logical/examples/restored-postgres.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kubedb.com/v1 | ||
kind: Postgres | ||
metadata: | ||
name: restored-postgres | ||
namespace: demo | ||
spec: | ||
init: | ||
waitForInitialRestore: true | ||
version: "16.4" | ||
replicas: 3 | ||
standbyMode: Hot | ||
streamingMode: Synchronous | ||
storageType: Durable | ||
storage: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
deletionPolicy: WipeOut |
21 changes: 21 additions & 0 deletions
21
docs/guides/postgres/backup/kubestash/logical/examples/restoresession.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: core.kubestash.com/v1alpha1 | ||
kind: RestoreSession | ||
metadata: | ||
name: sample-postgres-restore | ||
namespace: demo | ||
spec: | ||
target: | ||
apiGroup: kubedb.com | ||
kind: Postgres | ||
namespace: demo | ||
name: restored-postgres | ||
dataSource: | ||
repository: gcs-postgres-repo | ||
snapshot: latest | ||
encryptionSecret: | ||
name: encrypt-secret | ||
namespace: demo | ||
addon: | ||
name: postgres-addon | ||
tasks: | ||
- name: logical-backup-restore |
15 changes: 15 additions & 0 deletions
15
docs/guides/postgres/backup/kubestash/logical/examples/retentionpolicy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: storage.kubestash.com/v1alpha1 | ||
kind: RetentionPolicy | ||
metadata: | ||
name: demo-retention | ||
namespace: demo | ||
spec: | ||
default: true | ||
failedSnapshots: | ||
last: 2 | ||
maxRetentionPeriod: 2mo | ||
successfulSnapshots: | ||
last: 5 | ||
usagePolicy: | ||
allowedNamespaces: | ||
from: All |
18 changes: 18 additions & 0 deletions
18
docs/guides/postgres/backup/kubestash/logical/examples/sample-postgres.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: kubedb.com/v1 | ||
kind: Postgres | ||
metadata: | ||
name: sample-postgres | ||
namespace: demo | ||
spec: | ||
version: "16.4" | ||
replicas: 3 | ||
standbyMode: Hot | ||
streamingMode: Synchronous | ||
storageType: Durable | ||
storage: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
deletionPolicy: WipeOut |
Oops, something went wrong.