Skip to content

Commit 0c5f7bc

Browse files
bfeshtirenetapopova
andcommitted
Update Kubernetes oprations manual for backups (#2462)
Co-authored-by: Reneta Popova <[email protected]>
1 parent a297f5d commit 0c5f7bc

File tree

1 file changed

+123
-8
lines changed

1 file changed

+123
-8
lines changed

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

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ For performing backups, Neo4j uses the _Admin Service_, which is only available
88
For more information, see xref:kubernetes/accessing-neo4j.adoc[Accessing Neo4j].
99
====
1010

11+
[[kubernetes-backup-storage-options]]
12+
== Backup storage options
13+
14+
Neo4j's Helm chart supports both full and differential backups and can be configured to use cloud providers or local storage.
15+
16+
=== Cloud storage
17+
18+
Neo4j Helm chart uses Neo4j's native cloud storage integration with direct upload to create immutable backup objects.
19+
This allows you to back up your Neo4j databases directly to cloud storage without the need for persistent volumes.
20+
The chart can be configured to use cloud providers, such as AWS S3, Google Cloud Storage, and Azure Blob Storage, by setting the `cloudProvider` parameter to `aws`, `gcp`, or `azure` in the _backup-values.yaml_ file.
21+
22+
The following features are supported:
23+
24+
* *Direct cloud storage upload* - No intermediate local storage required.
25+
* *Differential backup chains* with `preferDiffAsParent: true`.
26+
* *Immutable backup objects* in cloud storage.
27+
* *Support for S3-compatible endpoints*.
28+
* *Enhanced S3 configuration* including custom CA certificates and endpoint settings.
29+
30+
=== Local storage
31+
32+
Local storage creates local backups in the `/backups` mount.
33+
This mount must be configured to use a persistent storage for large databases using `tempVolume`.
34+
The `cloudProvider` must be empty.
35+
1136
[[kubernetes-neo4j-backup-cloud]]
1237
== Prepare to back up a database(s) to a cloud provider (AWS, GCP, and Azure) bucket
1338

@@ -32,6 +57,12 @@ For more information, see link:https://min.io/docs/minio/linux/integrations/aws-
3257
* The latest Neo4j Helm charts.
3358
You can update the repository to get the latest charts using `helm repo update`.
3459

60+
[NOTE]
61+
====
62+
When using cloud providers, differential backups do not require persistent volumes with previous backups.
63+
Instead, the chart will first create a full backup in the cloud storage, and then, the subsequent backups will be differential backups that reference this full backup.
64+
====
65+
3566
=== Create a Kubernetes secret
3667

3768
You can create a Kubernetes secret with the credentials that can access the cloud provider bucket using one of the following options:
@@ -120,6 +151,10 @@ backup:
120151
cloudProvider: "gcp"
121152
secretName: "gcpcreds"
122153
secretKeyName: "credentials"
154+
# Enable cloud-native differential backups
155+
preferDiffAsParent: true
156+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
157+
fallbackToFull: true
123158
124159
consistencyCheck:
125160
enabled: true
@@ -145,6 +180,10 @@ backup:
145180
cloudProvider: "aws"
146181
secretName: "awscreds"
147182
secretKeyName: "credentials"
183+
# Enable cloud-native differential backups
184+
preferDiffAsParent: true
185+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
186+
fallbackToFull: true
148187
149188
consistencyCheck:
150189
enabled: true
@@ -170,6 +209,10 @@ backup:
170209
cloudProvider: "azure"
171210
secretName: "azurecreds"
172211
secretKeyName: "credentials"
212+
# Enable cloud-native differential backups
213+
preferDiffAsParent: true
214+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
215+
fallbackToFull: true
173216
174217
consistencyCheck:
175218
enabled: true
@@ -209,6 +252,10 @@ backup:
209252
cloudProvider: "gcp"
210253
secretName: ""
211254
secretKeyName: ""
255+
# Enable cloud-native differential backups
256+
preferDiffAsParent: true
257+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
258+
fallbackToFull: true
212259
213260
consistencyCheck:
214261
enabled: true
@@ -236,6 +283,10 @@ backup:
236283
cloudProvider: "aws"
237284
secretName: ""
238285
secretKeyName: ""
286+
# Enable cloud-native differential backups
287+
preferDiffAsParent: true
288+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
289+
fallbackToFull: true
239290
240291
consistencyCheck:
241292
enabled: true
@@ -262,6 +313,10 @@ backup:
262313
database: "neo4j,system"
263314
cloudProvider: "azure"
264315
azureStorageAccountName: "storageAccountName"
316+
# Enable cloud-native differential backups
317+
preferDiffAsParent: true
318+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
319+
fallbackToFull: true
265320
266321
consistencyCheck:
267322
enabled: true
@@ -283,7 +338,8 @@ tempVolume:
283338

284339
[NOTE]
285340
====
286-
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart.
341+
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart only when using local storage.
342+
When using cloud providers, persistent volumes are not required for differential backups.
287343
For more information, see xref:kubernetes/persistent-volumes.adoc[Volume mounts and persistent volumes].
288344
====
289345

@@ -306,6 +362,16 @@ backup:
306362
307363
# Optional: Skip TLS verification (not recommended for production)
308364
s3SkipVerify: false
365+
366+
# Optional: Force path-style addressing for S3 requests
367+
s3ForcePathStyle: true
368+
369+
# Optional: Specify S3 region
370+
s3Region: "us-east-1"
371+
372+
# Alternative: Use Kubernetes secret for CA certificate
373+
s3CASecretName: "s3-ca-cert"
374+
s3CASecretKey: "ca.crt"
309375
----
310376

311377
The following are examples of how to configure the backup system for different S3-compatible storage providers:
@@ -381,6 +447,29 @@ backup:
381447
* Legacy MinIO support through the `minioEndpoint` parameter is deprecated - use `s3Endpoint` instead.
382448
====
383449

450+
=== S3 CA certificate setup
451+
452+
For S3 endpoints with custom CA certificates, use a Kubernetes secret to manage the CA certificate:
453+
454+
. Create the CA certificate secret:
455+
+
456+
[source, bash]
457+
----
458+
kubectl create secret generic s3-ca-cert --from-file=ca.crt=/path/to/your/ca.crt
459+
----
460+
461+
. Configure the backup job:
462+
+
463+
[source, yaml]
464+
----
465+
backup:
466+
cloudProvider: "aws"
467+
s3Endpoint: "https://your-s3-endpoint.com"
468+
s3CASecretName: "s3-ca-cert"
469+
s3CASecretKey: "ca.crt"
470+
s3EndpointTLS: true # Automatically set when s3CASecretName is provided
471+
----
472+
384473

385474
[[kubernetes-neo4j-backup-on-prem]]
386475
== Prepare to back up a database(s) to on-premises storage
@@ -390,7 +479,8 @@ When configuring the _backup-values.yaml_ file, keep the “cloudProvider” fie
390479

391480
[NOTE]
392481
====
393-
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart.
482+
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart only when using local storage.
483+
When using cloud providers, persistent volumes are not required for differential backups.
394484
For more information, see xref:kubernetes/persistent-volumes.adoc[Volume mounts and persistent volumes].
395485
====
396486

@@ -502,6 +592,13 @@ backup:
502592
s3CACert: ""
503593
# Optional: Skip TLS verification (not recommended for production)
504594
s3SkipVerify: false
595+
# Optional: Force path-style addressing for S3 requests
596+
s3ForcePathStyle: false
597+
# Optional: Specify S3 region
598+
s3Region: ""
599+
# Alternative: Use Kubernetes secret for CA certificate
600+
s3CASecretName: ""
601+
s3CASecretKey: ""
505602
#name of the database to backup ex: neo4j or neo4j,system (You can provide command separated database names)
506603
# In case of comma separated databases failure of any single database will lead to failure of complete operation
507604
database: ""
@@ -551,6 +648,11 @@ backup:
551648
parallelRecovery: false
552649
verbose: true
553650
heapSize: ""
651+
# Enable differential backups using the latest differential backup as parent
652+
# This eliminates the need for persistent volumes when using cloud providers
653+
preferDiffAsParent: false
654+
# Fallback to FULL backup if DIFF backup fails
655+
fallbackToFull: true
554656
555657
# https://neo4j.com/docs/operations-manual/current/backup-restore/aggregate/
556658
# Performs aggregate backup. If enabled, NORMAL BACKUP WILL NOT BE DONE only aggregate backup
@@ -890,12 +992,7 @@ cypher-shell -u neo4j -p <password> -d system
890992
----
891993
DROP DATABASE neo4j;
892994
----
893-
. Exit the Cypher Shell command-line console:
894-
+
895-
[source, shell, role='noheader']
896-
----
897-
:exit;
898-
----
995+
. Exit the Cypher Shell command-line console by typing `:exit;`.
899996

900997
=== Restore the database backup
901998

@@ -949,3 +1046,21 @@ For more information, see xref:backup-restore/restore-backup.adoc#restore-backup
9491046
====
9501047
To restore the `system` database, follow the steps described in xref:kubernetes/operations/dump-load.adoc[Dump and load databases (offline)].
9511048
====
1049+
1050+
[[kubernetes-backup-migration]]
1051+
== Migrate from traditional to cloud-native backups
1052+
1053+
To migrate from persistent volume-based backups to cloud-native backups, you need to follow these steps:
1054+
1055+
. Perform a final traditional backup to ensure you have the latest data.
1056+
For more information, see <<kubernetes-neo4j-backup-on-prem, Prepare to back up a database(s) to on-premises storage>> and <<kubernetes-neo4j-backup, Back up your databases>>.
1057+
. Upload existing backups to the cloud storage bucket if needed.
1058+
You can use cloud provider CLI tools to transfer your backup files:
1059+
** For AWS S3: `aws s3 cp /path/to/backups s3://your-bucket/backups --recursive`
1060+
** For Google Cloud Storage: `gsutil cp -r /path/to/backups gs://your-bucket/backups`
1061+
** For Azure Blob Storage: `az storage blob upload-batch --source /path/to/backups --destination your-container`
1062+
. Update the _backup-values.yaml_ file to configure the cloud provider, bucket name, and credentials.
1063+
See <<kubernetes-neo4j-backup-cloud, Prepare to back up a database(s) to a cloud provider (AWS, GCP, and Azure) bucket>> for details.
1064+
. Install the _neo4j-admin_ Helm chart with the updated _backup-values.yaml_ file to back up your databases to the cloud provider bucket.
1065+
See <<_back_up_your_databases, Back up your databases>> for details.
1066+

0 commit comments

Comments
 (0)