Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
1f15d72c
Commit
1f15d72c
authored
Dec 11, 2020
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take postgres backup on upgrade
parent
dbde7485
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
test/nextcloud/1.0.0/templates/_helpers.tpl
test/nextcloud/1.0.0/templates/_helpers.tpl
+7
-0
test/nextcloud/1.0.0/templates/backup-postgres-hook.yaml
test/nextcloud/1.0.0/templates/backup-postgres-hook.yaml
+36
-0
test/nextcloud/1.0.0/templates/deployment.yaml
test/nextcloud/1.0.0/templates/deployment.yaml
+1
-1
No files found.
test/nextcloud/1.0.0/templates/_helpers.tpl
View file @
1f15d72c
...
...
@@ -120,3 +120,10 @@ Nextcloud service account
{{- define "nextcloud.serviceAccountName" -}}
{{- printf "%s-service-account" .Release.Name -}}
{{- end -}}
{
{
/*
Get
Nextloud
Postgres
Database
Name
*/
}
}
{{- define "postgres.DatabaseName" -}}
{{- print "nextcloud" -}}
{{- end -}}
test/nextcloud/1.0.0/templates/backup-postgres-hook.yaml
0 → 100644
View file @
1f15d72c
apiVersion
:
batch/v1
kind
:
Job
metadata
:
name
:
"
pre-upgrade-hook2"
annotations
:
"
helm.sh/hook"
:
pre-upgrade
"
helm.sh/hook-weight"
:
"
1"
"
helm.sh/hook-delete-policy"
:
hook-succeeded
spec
:
template
:
metadata
:
name
:
"
pre-upgrade-hook2"
spec
:
restartPolicy
:
Never
serviceAccountName
:
{{
template "nextcloud.serviceAccountName"
}}
containers
:
-
name
:
{{
.Chart.Name
}}
-postgres-backup
image
:
"
postgres:13.1"
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
env
:
-
name
:
POSTGRES_USER
valueFrom
:
secretKeyRef
:
name
:
db-details
key
:
db-user
-
name
:
POSTGRES_PASSWORD
valueFrom
:
secretKeyRef
:
name
:
db-details
key
:
db-password
volumeMounts
:
-
name
:
postgres-data
mountPath
:
/var/lib/postgresql/data
-
name
:
postgres-backup
mountPath
:
/postgres_backups
command
:
[
'
sh'
,
'
-c'
,
"
/docker-entrypoint.sh;
pg_dump
-U
$POSTGRES_USER
-d
{{
template
"
postgres.DatabaseName"
}}
>
/postgres_backups/update_dump;"
]
test/nextcloud/1.0.0/templates/deployment.yaml
View file @
1f15d72c
...
...
@@ -49,7 +49,7 @@ spec:
-
name
:
POSTGRES_HOST
value
:
{{
template "nextcloud.fullname" .
}}
-postgres:5432
-
name
:
POSTGRES_DB
value
:
"
nextcloud"
value
:
{{
template "postgres.DatabaseName"
}}
-
name
:
POSTGRES_USER
valueFrom
:
secretKeyRef
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment