Skip to content

Commit a60b0f2

Browse files
committed
rewriting the backup page to include workload integration
1 parent 66a0567 commit a60b0f2

File tree

1 file changed

+129
-68
lines changed

1 file changed

+129
-68
lines changed

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

Lines changed: 129 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,28 @@ For more information, see xref:kubernetes/accessing-neo4j.adoc[Accessing Neo4j].
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.0, the _neo4j/neo4j-admin_ Helm chart also supports performing a backup of multiple databases.
16+
And from 5.13.0, the _neo4j/neo4j-admin_ Helm chart also supports workload identity integration for GCP, AWS, and Azure.
1617

1718
=== Prerequisites
1819

1920
Before you can back up a database and upload it to your bucket, verify that you have the following:
2021

2122
* A cloud provider bucket (AWS, GCP, or Azure) with read and write access to be able to upload the backup.
2223
* Credentials to access the cloud provider bucket, such as a service account JSON key file for GCP, a credentials file for AWS, or storage account credentials for Azure.
24+
* A service account with workload identity if you want to use workload identity integration to access the cloud provider bucket.
25+
** For more information on setting up a service account with workload identity on GCP and AWS, see:
26+
*** link:https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity[Google Kubernetes Engine (GKE) -> Use Workload Identity]
27+
*** link:https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html[Amazon EKS -> Configuring a Kubernetes service account to assume an IAM role]
28+
** For more information on setting up an Azure storage account with workload identity, link:https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview?tabs=go[Microsoft Azure -> Use Microsoft Entra Workload ID with Azure Kubernetes Service (AKS)]
2329
* A Kubernetes cluster running on one of the cloud providers with the Neo4j Helm chart installed.
2430
For more information, see xref:kubernetes/quickstart-standalone/index.adoc[Quickstart: Deploy a standalone instance] or xref:kubernetes/quickstart-cluster/index.adoc[Quickstart: Deploy a cluster].
31+
* The latest Neo4j Helm charts.
32+
You can update the repository to get the latest charts using `helm repo update`.
2533

26-
=== Steps
34+
=== Create a Kubernetes secret
2735

28-
To perform a backup of a Neo4j database to any cloud provider (AWS, GCP, and Azure) bucket, follow these steps:
36+
You can create a Kubernetes secret with the credentials that can access the cloud provider bucket using one of the following options:
2937

30-
. Update the repository to get the latest charts:
31-
+
32-
[source, shell, role='noheader']
33-
----
34-
helm repo update
35-
----
36-
. Configure the credentials to access the cloud provider bucket by either using a service account or a Kubernetes secret:
37-
+
38-
Service account::
39-
In some deployment situations, it may be desirable to assign a Kubernetes Service Account to the Neo4j pod.
40-
For example, if processes in the pod want to connect to services that require Service Account authorization.
41-
To configure the Neo4j pod to use a Kubernetes service account, set `podSpec.serviceAccountName` to the name of the service account to use.
42-
+
43-
For example:
44-
+
45-
[source, yaml]
46-
----
47-
# neo4j-values.yaml
48-
neo4j:
49-
password: "my-password"
50-
51-
podSpec:
52-
serviceAccountName: "sa-name"
53-
----
54-
+
55-
[NOTE]
56-
====
57-
The service account must already exist.
58-
The Neo4j Helm chart does not create or configure Service Accounts.
59-
For more information on setting up a service account with workload identity, see the respective cloud provider documentation:
60-
61-
* link:https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview?tabs=go[Microsoft Azure -> Use Microsoft Entra Workload ID with Azure Kubernetes Service (AKS)]
62-
* link:https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity[Google Kubernetes Engine (GKE) -> Use Workload Identity]
63-
* link:https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html[Amazon EKS -> Configuring a Kubernetes service account to assume an IAM role]
64-
====
65-
66-
Kubernetes secret::
67-
Alternatively, you can create a Kubernetes secret with the credentials to access the cloud provider bucket using one of the following options:
68-
+
6938
[.tabbed-example]
7039
=====
7140
[.include-with-gke]
@@ -116,14 +85,105 @@ kubectl create secret generic azurecred --from-file=credentials=/path/to/your/cr
11685
======
11786
=====
11887

119-
. Configure the backup parameters in the _backup-values.yaml_ file by providing either `secretName` and `secretKeyName` or `serviceAccountName` as per your cloud provider:
120-
+
88+
=== Configure the backup parameters
89+
90+
You can configure the backup parameters in the _backup-values.yaml_ file either by using the `secretName` and `secretKeyName` parameters or by mapping the Kubernetes service account
91+
to the workload identity integration.
92+
12193
[NOTE]
12294
====
12395
The following examples show the minimum configuration required to perform a backup to a cloud provider bucket.
12496
For more information about the available backup parameters, see <<kubernetes-neo4j-backup-parameters, Backup parameters>>.
12597
====
126-
+
98+
99+
==== Configure the _backup-values.yaml_ file using the `secretName` and `secretKeyName` parameters
100+
101+
[.tabbed-example]
102+
=====
103+
[.include-with-gke]
104+
======
105+
[source, yaml, role='noheader']
106+
----
107+
neo4j:
108+
image: "neo4j/helm-charts-backup"
109+
imageTag: "5.10.0"
110+
jobSchedule: "* * * * *"
111+
successfulJobsHistoryLimit: 3
112+
failedJobsHistoryLimit: 1
113+
backoffLimit: 3
114+
115+
backup:
116+
bucketName: "my-bucket"
117+
databaseAdminServiceName: "standalone-admin" #This is the Neo4j Admin Service name.
118+
database: "neo4j,system"
119+
cloudProvider: "gcp"
120+
secretName: "gcpcreds"
121+
secretKeyName: "credentials"
122+
123+
consistencyCheck:
124+
enabled: true
125+
----
126+
======
127+
128+
[.include-with-aws]
129+
======
130+
[source, yaml, role='noheader']
131+
----
132+
neo4j:
133+
image: "neo4j/helm-charts-backup"
134+
imageTag: "5.10.0"
135+
jobSchedule: "* * * * *"
136+
successfulJobsHistoryLimit: 3
137+
failedJobsHistoryLimit: 1
138+
backoffLimit: 3
139+
140+
backup:
141+
bucketName: "my-bucket"
142+
databaseAdminServiceName: "standalone-admin"
143+
database: "neo4j,system"
144+
cloudProvider: "aws"
145+
secretName: "awscreds"
146+
secretKeyName: "credentials"
147+
148+
consistencyCheck:
149+
enabled: true
150+
----
151+
======
152+
153+
[.include-with-azure]
154+
======
155+
[source, yaml, role='noheader']
156+
----
157+
neo4j:
158+
image: "neo4j/helm-charts-backup"
159+
imageTag: "5.10.0"
160+
jobSchedule: "* * * * *"
161+
successfulJobsHistoryLimit: 3
162+
failedJobsHistoryLimit: 1
163+
backoffLimit: 3
164+
165+
backup:
166+
bucketName: "my-bucket"
167+
databaseAdminServiceName: "standalone-admin"
168+
database: "neo4j,system"
169+
cloudProvider: "azure"
170+
secretName: "azurecreds"
171+
secretKeyName: "credentials"
172+
173+
consistencyCheck:
174+
enabled: true
175+
----
176+
======
177+
=====
178+
179+
==== Configure the _backup-values.yaml_ file using service account workload identity integration
180+
181+
In some deployment situations, it may be desirable to assign a Kubernetes Service Account to the Neo4j backup pod.
182+
For example, if processes in the pod want to connect to services that require Service Account authorization.
183+
To configure the Neo4j backup pod to use a Kubernetes service account, set `serviceAccountName` to the name of the service account to use.
184+
For Azure deployments, you also need to set the `azureStorageAccountName` parameter to the name of the Azure storage account, where the backup files will be uploaded.
185+
For example:
186+
127187
[.tabbed-example]
128188
=====
129189
[.include-with-gke]
@@ -133,6 +193,7 @@ For more information about the available backup parameters, see <<kubernetes-neo
133193
neo4j:
134194
image: "neo4j/helm-charts-backup"
135195
imageTag: "5.13.0"
196+
serviceAccountName: "demo-service-account"
136197
jobSchedule: "* * * * *"
137198
successfulJobsHistoryLimit: 3
138199
failedJobsHistoryLimit: 1
@@ -143,9 +204,8 @@ backup:
143204
databaseAdminServiceName: "standalone-admin" #This is the Neo4j Admin Service name.
144205
database: "neo4j,system"
145206
cloudProvider: "gcp"
146-
#secretName: "gcpcreds"
147-
#secretKeyName: "credentials"
148-
#gcpServiceAccountName: "gcp-sa"
207+
secretName: "gcpcreds"
208+
secretKeyName: "credentials"
149209
150210
consistencyCheck:
151211
enabled: true
@@ -159,6 +219,7 @@ consistencyCheck:
159219
neo4j:
160220
image: "neo4j/helm-charts-backup"
161221
imageTag: "5.13.0"
222+
serviceAccountName: "demo-service-account"
162223
jobSchedule: "* * * * *"
163224
successfulJobsHistoryLimit: 3
164225
failedJobsHistoryLimit: 1
@@ -169,9 +230,8 @@ backup:
169230
databaseAdminServiceName: "standalone-admin"
170231
database: "neo4j,system"
171232
cloudProvider: "aws"
172-
#secretName: "awscreds"
173-
#secretKeyName: "credentials"
174-
#awsServiceAccountName: "aws-sa"
233+
secretName: "awscreds"
234+
secretKeyName: "credentials"
175235
176236
consistencyCheck:
177237
enabled: true
@@ -185,6 +245,7 @@ consistencyCheck:
185245
neo4j:
186246
image: "neo4j/helm-charts-backup"
187247
imageTag: "5.13.0"
248+
serviceAccountName: "demo-service-account"
188249
jobSchedule: "* * * * *"
189250
successfulJobsHistoryLimit: 3
190251
failedJobsHistoryLimit: 1
@@ -195,45 +256,30 @@ backup:
195256
databaseAdminServiceName: "standalone-admin"
196257
database: "neo4j,system"
197258
cloudProvider: "azure"
198-
#secretName: "azurecreds"
199-
#secretKeyName: "credentials"
200-
#azureStorageAccountName: "storageAccountName"
259+
azureStorageAccountName: "storageAccountName"
201260
202261
consistencyCheck:
203262
enabled: true
204263
----
205264
======
206265
=====
207-
+
208266
The _/backups_ mount created by default is an _emptyDir_ type volume.
209267
This means that the data stored in this volume is not persistent and will be lost when the pod is deleted.
210268
To use a persistent volume for backups add the following section to the _backup-values.yaml_ file:
211-
+
269+
212270
[source, yaml, role='noheader']
213271
----
214272
tempVolume:
215273
persistentVolumeClaim:
216274
claimName: backup-pvc
217275
----
218-
+
276+
219277
[NOTE]
220278
====
221279
You need to create the persistent volume and persistent volume claim before installing the _neo4j-admin_ Helm chart.
222280
For more information, see xref:kubernetes/persistent-volumes.adoc[Volume mounts and persistent volumes].
223281
====
224282

225-
. Install _neo4j-admin_ Helm chart using the _backup-values.yaml_ file:
226-
+
227-
[source, shell, role='noheader']
228-
----
229-
helm install backup-name neo4j-admin -f /path/to/your/backup-values.yaml
230-
----
231-
+
232-
The _neo4j/neo4j-admin_ Helm chart installs a cronjob that launches a pod based on the job schedule. 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.
233-
234-
. Monitor the backup pod logs using `kubectl logs pod/<neo4j-backup-pod-name>` to check the progress of the backup.
235-
. Check that the backup files and the consistency check reports have been uploaded to the cloud provider bucket.
236-
237283
[[kubernetes-neo4j-backup-parameters]]
238284
=== Backup parameters
239285

@@ -438,6 +484,21 @@ tolerations: []
438484
# effect: "NoSchedule"
439485
----
440486

487+
=== Install the _neo4j-admin_ Helm chart
488+
489+
. Install _neo4j-admin_ Helm chart using the _backup-values.yaml_ file:
490+
+
491+
[source, shell, role='noheader']
492+
----
493+
helm install backup-name neo4j-admin -f /path/to/your/backup-values.yaml
494+
----
495+
+
496+
The _neo4j/neo4j-admin_ Helm chart installs a cronjob that launches a pod based on the job schedule.
497+
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.
498+
499+
. Monitor the backup pod logs using `kubectl logs pod/<neo4j-backup-pod-name>` to check the progress of the backup.
500+
. Check that the backup files and the consistency check reports have been uploaded to the cloud provider bucket.
501+
441502
[[kubernetes-neo4j-restore]]
442503
== Restore a single database
443504

0 commit comments

Comments
 (0)