Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
k8s-postgresql
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
228aef4c
authored
2023-02-02 17:37:19 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add direct url restore.
1 parent
09de0410
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
charts/postgresql-rclone/templates/job-restore.yaml
charts/postgresql-rclone/values.yaml
charts/postgresql-rclone/templates/job-restore.yaml
View file @
228aef4
...
...
@@ -53,15 +53,21 @@ spec:
name
:
{{
include "postgresql-rclone.fullname" .
}}
-rclone
-
secretRef
:
name
:
{{
include "postgresql-rclone.fullname" .
}}
-rclone
{{
- if .Values.rclone.crypt.enabled
}}
env
:
{{
- if .Values.rclone.crypt.enabled
}}
-
name
:
RCLONE_CRYPT_REMOTE
{{
- else
}}
-
name
:
RCLONE_S3_REMOTE
{{
- end
}}
{{
- if .Values.restore.url
}}
value
:
"
:{{
.Values.restore.url
}}"
{{
- else
}}
value
:
"
:s3:$(S3_BUCKET)/$(S3_PREFIX)/last/"
{{
- end
}}
{{
- if .Values.rclone.crypt.enabled
}}
args
:
[
"
copy"
,
"
:crypt:"
,
"
/restores/"
]
args
:
[
"
copy"
,
"
:crypt:"
,
"
/restores/
.work/
"
]
{{
- else
}}
args
:
[
"
-v"
,
"
copy"
,
"
:s3:$(S3_BUCKET)/$(S3_PREFIX)/last/
"
,
"
/restores/.work/"
]
args
:
[
"
-v"
,
"
copy"
,
"
$(RCLONE_S3_REMOTE)
"
,
"
/restores/.work/"
]
{{
- end
}}
{{
- end
}}
-
name
:
link-latest
...
...
@@ -74,9 +80,13 @@ spec:
-
bash
-
-cx
-
|-
{{
- if .Values.restore.url
}}
find /restores/.work -maxdepth 1 -mindepth 1 | \
{{
- else
}}
find /restores/.work -maxdepth 1 -mindepth 1 -name '*.sql.gz' | \
sort | \
awk '{split($1, a, /-([^-]*)-([^-]*)$/)} !uniq[a[1] a[2] a[3]]++' | \
{{
- end
}}
while read file; do \
ln -f "$file" "/restores/"
done
...
...
charts/postgresql-rclone/values.yaml
View file @
228aef4
...
...
@@ -36,6 +36,7 @@ backup:
size
:
10Gi
restore
:
url
:
"
"
job
:
ttlSecondsAfterFinished
:
60
pvc
:
...
...
Please
register
or
sign in
to post a comment