Skip to content

Commit d2d846f

Browse files
committed
Update Kubernetes oprations manual for backups
1 parent 47973b3 commit d2d846f

File tree

1 file changed

+164
-0
lines changed

1 file changed

+164
-0
lines changed

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

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,65 @@ 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-modes]]
12+
== Backup modes
13+
14+
Neo4j's Helm chart supports two backup modes:
15+
16+
=== Cloud provider mode
17+
Uses Neo4j's native cloud storage integration with direct upload to create immutable backup objects:
18+
19+
* **Supported providers**: AWS S3, Google Cloud Storage, Azure Blob Storage
20+
* **Benefits**: No persistent volume requirements, supports differential backups, immutable backup objects
21+
* **Configuration**: Set `cloudProvider` to `aws`, `gcp`, or `azure`
22+
23+
=== Local mode
24+
Creates local backups in `/backups` mount:
25+
26+
* **Requirements**: Persistent storage for large databases (configured via `tempVolume`)
27+
* **Configuration**: Leave `cloudProvider` empty
28+
29+
[[kubernetes-cloud-native-features]]
30+
== Cloud-native backup features
31+
32+
When using cloud providers, Neo4j's native backup provides:
33+
34+
* **Direct cloud storage upload** - No intermediate local storage required
35+
* **Differential backup chains** with `preferDiffAsParent: true`
36+
* **Immutable backup objects** in cloud storage
37+
* **Support for S3-compatible endpoints**
38+
* **Enhanced S3 configuration** including custom CA certificates and endpoint settings
39+
40+
[[kubernetes-differential-backups]]
41+
== Differential backups
42+
43+
For cloud providers, differential backups eliminate the need for persistent volumes:
44+
45+
[source, yaml, subs="attributes+,+macros"]
46+
----
47+
backup:
48+
cloudProvider: "aws"
49+
bucketName: "my-backups"
50+
preferDiffAsParent: true
51+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
52+
fallbackToFull: true # Fallback to FULL if DIFF fails
53+
----
54+
55+
**How it works:**
56+
57+
1. First backup creates a FULL backup in cloud storage
58+
2. Subsequent backups create DIFF backups that reference the cloud-stored FULL backup
59+
3. No local storage of previous backups required
60+
61+
[NOTE]
62+
====
63+
**`preferDiffAsParent` is fully supported and eliminates the need for persistent volumes!**
64+
65+
* **Helm Value**: `backup.preferDiffAsParent: true`
66+
* **Cloud-Native**: DIFF backups reference cloud-stored FULL backups directly
67+
* **No PV Required**: Previous backups don't need to be stored locally
68+
====
69+
1170
[[kubernetes-neo4j-backup-cloud]]
1271
== Prepare to back up a database(s) to a cloud provider (AWS, GCP, and Azure) bucket
1372

@@ -120,6 +179,10 @@ backup:
120179
cloudProvider: "gcp"
121180
secretName: "gcpcreds"
122181
secretKeyName: "credentials"
182+
# Enable cloud-native differential backups
183+
preferDiffAsParent: true
184+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
185+
fallbackToFull: true
123186
124187
consistencyCheck:
125188
enabled: true
@@ -145,6 +208,10 @@ backup:
145208
cloudProvider: "aws"
146209
secretName: "awscreds"
147210
secretKeyName: "credentials"
211+
# Enable cloud-native differential backups
212+
preferDiffAsParent: true
213+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
214+
fallbackToFull: true
148215
149216
consistencyCheck:
150217
enabled: true
@@ -170,6 +237,10 @@ backup:
170237
cloudProvider: "azure"
171238
secretName: "azurecreds"
172239
secretKeyName: "credentials"
240+
# Enable cloud-native differential backups
241+
preferDiffAsParent: true
242+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
243+
fallbackToFull: true
173244
174245
consistencyCheck:
175246
enabled: true
@@ -209,6 +280,10 @@ backup:
209280
cloudProvider: "gcp"
210281
secretName: ""
211282
secretKeyName: ""
283+
# Enable cloud-native differential backups
284+
preferDiffAsParent: true
285+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
286+
fallbackToFull: true
212287
213288
consistencyCheck:
214289
enabled: true
@@ -236,6 +311,10 @@ backup:
236311
cloudProvider: "aws"
237312
secretName: ""
238313
secretKeyName: ""
314+
# Enable cloud-native differential backups
315+
preferDiffAsParent: true
316+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
317+
fallbackToFull: true
239318
240319
consistencyCheck:
241320
enabled: true
@@ -262,6 +341,10 @@ backup:
262341
database: "neo4j,system"
263342
cloudProvider: "azure"
264343
azureStorageAccountName: "storageAccountName"
344+
# Enable cloud-native differential backups
345+
preferDiffAsParent: true
346+
type: "AUTO" # First backup will be FULL, subsequent ones DIFF
347+
fallbackToFull: true
265348
266349
consistencyCheck:
267350
enabled: true
@@ -306,6 +389,16 @@ backup:
306389
307390
# Optional: Skip TLS verification (not recommended for production)
308391
s3SkipVerify: false
392+
393+
# Optional: Force path-style addressing for S3 requests
394+
s3ForcePathStyle: true
395+
396+
# Optional: Specify S3 region
397+
s3Region: "us-east-1"
398+
399+
# Alternative: Use Kubernetes secret for CA certificate
400+
s3CASecretName: "s3-ca-cert"
401+
s3CASecretKey: "ca.crt"
309402
----
310403

311404
The following are examples of how to configure the backup system for different S3-compatible storage providers:
@@ -381,6 +474,31 @@ backup:
381474
* Legacy MinIO support through the `minioEndpoint` parameter is deprecated - use `s3Endpoint` instead.
382475
====
383476

477+
=== S3 CA certificate setup
478+
479+
For S3 endpoints with custom CA certificates:
480+
481+
==== Using Kubernetes secrets
482+
483+
1. **Create the CA certificate secret:**
484+
+
485+
[source, bash]
486+
----
487+
kubectl create secret generic s3-ca-cert --from-file=ca.crt=/path/to/your/ca.crt
488+
----
489+
490+
2. **Configure the backup job:**
491+
+
492+
[source, yaml]
493+
----
494+
backup:
495+
cloudProvider: "aws"
496+
s3Endpoint: "https://your-s3-endpoint.com"
497+
s3CASecretName: "s3-ca-cert"
498+
s3CASecretKey: "ca.crt"
499+
s3EndpointTLS: true # Automatically set when s3CASecretName is provided
500+
----
501+
384502

385503
[[kubernetes-neo4j-backup-on-prem]]
386504
== Prepare to back up a database(s) to on-premises storage
@@ -502,6 +620,13 @@ backup:
502620
s3CACert: ""
503621
# Optional: Skip TLS verification (not recommended for production)
504622
s3SkipVerify: false
623+
# Optional: Force path-style addressing for S3 requests
624+
s3ForcePathStyle: false
625+
# Optional: Specify S3 region
626+
s3Region: ""
627+
# Alternative: Use Kubernetes secret for CA certificate
628+
s3CASecretName: ""
629+
s3CASecretKey: ""
505630
#name of the database to backup ex: neo4j or neo4j,system (You can provide command separated database names)
506631
# In case of comma separated databases failure of any single database will lead to failure of complete operation
507632
database: ""
@@ -551,6 +676,11 @@ backup:
551676
parallelRecovery: false
552677
verbose: true
553678
heapSize: ""
679+
# Enable differential backups using the latest differential backup as parent
680+
# This eliminates the need for persistent volumes when using cloud providers
681+
preferDiffAsParent: false
682+
# Fallback to FULL backup if DIFF backup fails
683+
fallbackToFull: true
554684
555685
# https://neo4j.com/docs/operations-manual/current/backup-restore/aggregate/
556686
# Performs aggregate backup. If enabled, NORMAL BACKUP WILL NOT BE DONE only aggregate backup
@@ -949,3 +1079,37 @@ For more information, see xref:backup-restore/restore-backup.adoc#restore-backup
9491079
====
9501080
To restore the `system` database, follow the steps described in xref:kubernetes/operations/dump-load.adoc[Dump and load databases (offline)].
9511081
====
1082+
1083+
[[kubernetes-backup-migration]]
1084+
== Migration from traditional to cloud-native backups
1085+
1086+
To migrate from persistent volume-based backups to cloud-native:
1087+
1088+
1. **Perform final traditional backup**
1089+
2. **Upload existing backups to cloud storage** (if needed)
1090+
3. **Update configuration** to use cloud provider
1091+
4. **Remove persistent volume configuration**
1092+
5. **Enable `preferDiffAsParent`** for future differential backups
1093+
1094+
.Example migration
1095+
[source, yaml]
1096+
----
1097+
# Before (Traditional)
1098+
backup:
1099+
database: "neo4j"
1100+
databaseAdminServiceName: "neo4j-admin"
1101+
tempVolume:
1102+
persistentVolumeClaim:
1103+
claimName: "backup-pvc"
1104+
1105+
# After (Cloud-Native)
1106+
backup:
1107+
cloudProvider: "aws"
1108+
bucketName: "neo4j-backups"
1109+
database: "neo4j"
1110+
databaseAdminServiceName: "neo4j-admin"
1111+
secretName: "aws-credentials"
1112+
secretKeyName: "credentials"
1113+
preferDiffAsParent: true
1114+
# tempVolume configuration removed
1115+
----

0 commit comments

Comments
 (0)