Skip to content

Commit f20d6ea

Browse files
authored
Add support for backing up a database to on-prem storage (#1418) (#1420)
Cherry-picked from #1418
1 parent 4c12d34 commit f20d6ea

File tree

1 file changed

+54
-6
lines changed

1 file changed

+54
-6
lines changed

modules/ROOT/pages/kubernetes/operations/backup-restore.adoc

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For more information, see xref:kubernetes/accessing-neo4j.adoc[Accessing Neo4j].
99
====
1010

1111
[[kubernetes-neo4j-backup-cloud]]
12-
== Back up a database(s) to a cloud provider (AWS, GCP, and Azure) bucket
12+
== Prepare to back up a database(s) to a cloud provider (AWS, GCP, and Azure) bucket
1313

1414
You can perform a backup of a Neo4j database(s) to any cloud provider (AWS, GCP, and Azure) bucket using the _neo4j/neo4j-admin_ Helm chart.
1515
From Neo4j 5.10, the _neo4j/neo4j-admin_ Helm chart also supports performing a backup of multiple databases.
@@ -323,9 +323,48 @@ consistencyCheck:
323323
enabled: true
324324
----
325325

326+
[[kubernetes-neo4j-backup-on-prem]]
327+
== Prepare to back up a database(s) to on-premises storage
328+
329+
_This feature is available from Neo4j 5.16._
330+
331+
You can perform a backup of a Neo4j database(s) to on-premises storage using the _neo4j/neo4j-admin_ Helm chart.
332+
When configuring the _backup-values.yaml_ file, keep the “cloudProvider” field empty and provide a persistent volume in the `tempVolume` section to ensure the backup files are persistent if the pod is deleted.
333+
334+
[NOTE]
335+
====
336+
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart.
337+
For more information, see xref:kubernetes/persistent-volumes.adoc[Volume mounts and persistent volumes].
338+
====
339+
340+
For example:
341+
342+
[source, yaml, role='noheader']
343+
----
344+
neo4j:
345+
image: "neo4j/helm-charts-backup"
346+
imageTag: "5.16.0"
347+
jobSchedule: "* * * * *"
348+
successfulJobsHistoryLimit: 3
349+
failedJobsHistoryLimit: 1
350+
backoffLimit: 3
351+
352+
backup:
353+
bucketName: "my-bucket"
354+
databaseAdminServiceName: "standalone-admin"
355+
database: "neo4j,system"
356+
cloudProvider:
357+
358+
consistencyCheck:
359+
enabled: true
360+
361+
tempVolume:
362+
persistentVolumeClaim:
363+
claimName: backup-pvc
364+
----
326365

327366
[[kubernetes-neo4j-backup-parameters]]
328-
=== Backup parameters
367+
== Backup parameters
329368

330369
To see what options are configurable on the Helm chart use `helm show values` and the Helm chart _neo4j/neo4j-admin_. +
331370
From Neo4j 5.10, the _neo4j/neo4j-admin_ Helm chart also supports assigning your Neo4j pods to specific nodes using `nodeSelector` labels, and from Neo4j 5.11, using affinity/anti-affinity rules or tolerations.
@@ -351,7 +390,7 @@ disableLookups: false
351390
352391
neo4j:
353392
image: "neo4j/helm-charts-backup"
354-
imageTag: "5.13.0"
393+
imageTag: "5.16.0"
355394
podLabels: {}
356395
# app: "demo"
357396
# acac: "dcdddc"
@@ -395,7 +434,6 @@ backup:
395434
databaseBackupPort: ""
396435
#default value is cluster.local
397436
databaseClusterDomain: ""
398-
399437
# specify minio endpoint ex: http://demo.minio.svc.cluster.local:9000
400438
# please ensure this endpoint is the s3 api endpoint or else the backup helm chart will fail
401439
# as of now it works only with non tls endpoints
@@ -406,8 +444,12 @@ backup:
406444
# In case of comma separated databases failure of any single database will lead to failure of complete operation
407445
database: ""
408446
# cloudProvider can be either gcp, aws, or azure
447+
# if cloudProvider is empty then the backup will be done to the /backups mount.
448+
# the /backups mount can point to a persitentVolume based on the definition set in tempVolume
409449
cloudProvider: ""
410450
451+
452+
411453
# name of the kubernetes secret containing the respective cloud provider credentials
412454
# Ensure you have read,write access to the mentioned bucket
413455
# For AWS :
@@ -490,8 +532,12 @@ securityContext:
490532
resources:
491533
requests:
492534
ephemeralStorage: "4Gi"
535+
cpu: ""
536+
memory: ""
493537
limits:
494538
ephemeralStorage: "5Gi"
539+
cpu: ""
540+
memory: ""
495541
496542
# nodeSelector labels
497543
# please ensure the respective labels are present on one of nodes or else helm charts will throw an error
@@ -534,7 +580,9 @@ tolerations: []
534580
# effect: "NoSchedule"
535581
----
536582

537-
=== Install the _neo4j-admin_ Helm chart
583+
== Back up your database(s)
584+
585+
To back up your database(s), you install the _neo4j-admin_ Helm chart using the configured _backup-values.yaml_ file.
538586

539587
. Install _neo4j-admin_ Helm chart using the _backup-values.yaml_ file:
540588
+
@@ -547,7 +595,7 @@ The _neo4j/neo4j-admin_ Helm chart installs a cronjob that launches a pod based
547595
This pod performs a backup of one or multiple databases, a consistency check of the backup file(s), and uploads them to the cloud provider bucket.
548596

549597
. Monitor the backup pod logs using `kubectl logs pod/<neo4j-backup-pod-name>` to check the progress of the backup.
550-
. Check that the backup files and the consistency check reports have been uploaded to the cloud provider bucket.
598+
. Check that the backup files and the consistency check reports have been uploaded to the cloud provider bucket or on-premises storage.
551599

552600
[[kubernetes-neo4j-restore]]
553601
== Restore a single database

0 commit comments

Comments
 (0)