Skip to content

Commit eb5b663

Browse files
authored
fix: Fixed neo4j backup values (#3)
* fix: Fixed neo4j backup values * fix: Fixed spacing in helm template
1 parent 0419099 commit eb5b663

3 files changed

Lines changed: 27 additions & 28 deletions

File tree

charts/neo4j-backup/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: neo4j-backup
33
description: Backup Neo4J databases to GCS
44
type: application
5-
version: 0.1.2
5+
version: 0.1.3
66
appVersion: "1.0.0"

charts/neo4j-backup/templates/deployment.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: CronJob
33
metadata:
44
name: {{ .Release.Name }}-neo4j-backup
55
spec:
6-
schedule: {{ default "0 3 * * *" .Values.backup.schedule }}
6+
schedule: {{ default "0 3 * * *" .Values.schedule }}
77
jobTemplate:
88
spec:
99
template:
@@ -16,16 +16,16 @@ spec:
1616
- "-c"
1717
- |
1818
set -e
19-
if [ ! -d "/mnt/backups/{{ required "Name must provided" .Values.backup.name }}" ]; then
20-
mkdir /mnt/backups/{{.Values.backup.name}}
19+
if [ ! -d "/mnt/backups/{{ required "Name must provided" .Values.name }}" ]; then
20+
mkdir /mnt/backups/{{ .Values.name }}
2121
fi
2222
old_IFS=$IFS
2323
IFS=','
24-
db_names="{{- join "," .Values.backup.databases }}"
24+
db_names="{{ - join "," .Values.databases }}"
2525
for db in $db_names; do
2626
neo4j-admin database backup \
27-
--from={{ required "Backup service must be provided" .Values.backup.service }} \
28-
--to-path=/mnt/backups/{{.Values.backup.name}} \
27+
--from={{ required "Backup service must be provided" .Values.service }} \
28+
--to-path=/mnt/backups/{{ .Values.name }} \
2929
--verbose $db
3030
done
3131
IFS=$old_IFS
@@ -35,17 +35,17 @@ spec:
3535
readOnly: false
3636
resources:
3737
limits:
38-
cpu: {{ default "200m" .Values.backup.resources.cpu }}
39-
memory: {{ default "800Mi" .Values.backup.resources.memory }}
38+
cpu: {{ default "200m" .Values.resources.cpu }}
39+
memory: {{ default "800Mi" .Values.resources.memory }}
4040
containers:
4141
- name: gcs-fuse
4242
image: shubham030/gcs-fuse
4343
command:
4444
- "/bin/sh"
4545
- "-c"
4646
- |
47-
echo {{ required "Service Account is required" .Values.backup.serviceAccount }} | base64 -d > /etc/gcloud/service-account.json
48-
gcsfuse {{ required "Bucket name must be provided" .Values.backup.bucket }} /mnt/gcs
47+
echo {{ required "Service Account is required" .Values.serviceAccount }} | base64 -d > /etc/gcloud/service-account.json
48+
gcsfuse {{ required "Bucket name must be provided" .Values.bucket }} /mnt/gcs
4949
mv /mnt/backups/* /mnt/gcs/
5050
volumeMounts:
5151
- name: gcs-creds-volume
@@ -56,7 +56,7 @@ spec:
5656
mountPath: /mnt/backups
5757
securityContext:
5858
privileged: true
59-
restartPolicy: {{ default "OnFailure" .Values.backup.restartPolicy }}
59+
restartPolicy: {{ default "OnFailure" .Values.restartPolicy }}
6060
volumes:
6161
- name: shared-volume
6262
emptyDir: {}

charts/neo4j-backup/values.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
backup:
2-
# The name of the GCS bucket where the backups will be stored.
3-
bucket: "test"
4-
# The path where the backups will be stored within the given bucket.
5-
name: ""
6-
# The address of the Kubernetes service where the backup is being taken from.
7-
service: "cluster-name"
8-
# A list of databases that need to be backed up.
9-
databases: # The amount of memory and CPU to use for the backup job.
10-
resources:
11-
cpu: ""
12-
memory: ""
13-
# The restart policy for the backup job.
14-
restartPolicy: ""
15-
# Google serviceAccount with read and write access to the bucket.
16-
serviceAccount: ""
1+
# The name of the GCS bucket where the backups will be stored.
2+
bucket: "test"
3+
# The path where the backups will be stored within the given bucket.
4+
name: ""
5+
# The address of the Kubernetes service where the backup is being taken from.
6+
service: "cluster-name"
7+
# A list of databases that need to be backed up.
8+
databases: # The amount of memory and CPU to use for the backup job.
9+
resources:
10+
cpu: ""
11+
memory: ""
12+
# The restart policy for the backup job.
13+
restartPolicy: ""
14+
# Google serviceAccount with read and write access to the bucket.
15+
serviceAccount: ""

0 commit comments

Comments
 (0)