-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
480 additions
and
23 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
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,7 @@ | ||
#!/bin/bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
docker stop backrest | ||
docker rm backrest | ||
docker volume rm br-pgdata br-backups |
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,28 @@ | ||
#!/bin/bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
$DIR/cleanup.sh | ||
|
||
docker run \ | ||
--publish 5432:5432 \ | ||
--volume br-pgdata:/pgdata \ | ||
--volume br-backups:/backrestrepo \ | ||
--env PG_MODE=primary \ | ||
--env PG_USER=testuser \ | ||
--env PG_PASSWORD=password \ | ||
--env PG_DATABASE=userdb \ | ||
--env PG_PRIMARY_USER=primaryuser \ | ||
--env PG_PRIMARY_PORT=5432 \ | ||
--env PG_PRIMARY_PASSWORD=password \ | ||
--env PG_ROOT_PASSWORD=password \ | ||
--env PGHOST=/tmp \ | ||
--env PGBACKREST_STANZA=db \ | ||
--env PGBACKREST_REPO_PATH=/backrestrepo/backrest-backups \ | ||
--env PGBACKREST_DB_PATH=/pgdata/backrest \ | ||
--env PGBACKREST_LOG_PATH=/tmp \ | ||
--env ARCHIVE_MODE=on \ | ||
--env ARCHIVE_TIMEOUT=60 \ | ||
--name=backrest \ | ||
--hostname=backrest \ | ||
--detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} |
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,43 @@ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "PersistentVolume", | ||
"metadata": { | ||
"name": "$CCP_NAMESPACE-br-pgdata", | ||
"labels": { | ||
"name": "$CCP_NAMESPACE-br-pgdata" | ||
} | ||
}, | ||
"spec": { | ||
"capacity": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
}, | ||
"accessModes": ["$CCP_STORAGE_MODE"], | ||
"nfs": { | ||
"path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest", | ||
"server": "$CCP_NFS_IP" | ||
}, | ||
"persistentVolumeReclaimPolicy": "Retain" | ||
} | ||
} | ||
|
||
{ | ||
"apiVersion": "v1", | ||
"kind": "PersistentVolume", | ||
"metadata": { | ||
"name": "$CCP_NAMESPACE-br-backups", | ||
"labels": { | ||
"name": "$CCP_NAMESPACE-br-backups" | ||
} | ||
}, | ||
"spec": { | ||
"capacity": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
}, | ||
"accessModes": ["$CCP_STORAGE_MODE"], | ||
"nfs": { | ||
"path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest", | ||
"server": "$CCP_NFS_IP" | ||
}, | ||
"persistentVolumeReclaimPolicy": "Retain" | ||
} | ||
} |
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,41 @@ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "PersistentVolume", | ||
"metadata": { | ||
"name": "$CCP_NAMESPACE-br-pgdata", | ||
"labels": { | ||
"name": "$CCP_NAMESPACE-br-pgdata" | ||
} | ||
}, | ||
"spec": { | ||
"capacity": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
}, | ||
"accessModes": ["$CCP_STORAGE_MODE"], | ||
"hostPath": { | ||
"path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest" | ||
}, | ||
"persistentVolumeReclaimPolicy": "Retain" | ||
} | ||
} | ||
|
||
{ | ||
"apiVersion": "v1", | ||
"kind": "PersistentVolume", | ||
"metadata": { | ||
"name": "$CCP_NAMESPACE-br-backups", | ||
"labels": { | ||
"name": "$CCP_NAMESPACE-br-backups" | ||
} | ||
}, | ||
"spec": { | ||
"capacity": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
}, | ||
"accessModes": ["$CCP_STORAGE_MODE"], | ||
"hostPath": { | ||
"path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest" | ||
}, | ||
"persistentVolumeReclaimPolicy": "Retain" | ||
} | ||
} |
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,37 @@ | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "br-pgdata" | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"$CCP_STORAGE_MODE" | ||
], | ||
"storageClassName": "$CCP_STORAGE_CLASS", | ||
"resources": { | ||
"requests": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
} | ||
} | ||
} | ||
} | ||
|
||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "br-backups" | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"$CCP_STORAGE_MODE" | ||
], | ||
"storageClassName": "$CCP_STORAGE_CLASS", | ||
"resources": { | ||
"requests": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
} | ||
} | ||
} | ||
} |
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,45 @@ | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "br-pgdata" | ||
}, | ||
"spec": { | ||
"selector": { | ||
"matchLabels": { | ||
"name": "$CCP_NAMESPACE-br-pgdata" | ||
} | ||
}, | ||
"accessModes": [ | ||
"$CCP_STORAGE_MODE" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
} | ||
} | ||
} | ||
} | ||
|
||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "br-backups" | ||
}, | ||
"spec": { | ||
"selector": { | ||
"matchLabels": { | ||
"name": "$CCP_NAMESPACE-br-backups" | ||
} | ||
}, | ||
"accessModes": [ | ||
"$CCP_STORAGE_MODE" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "$CCP_STORAGE_CAPACITY" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.