Skip to content

Commit

Permalink
add files for neo4j4 migrating to neo4j5
Browse files Browse the repository at this point in the history
  • Loading branch information
J1e9n9n1y authored Oct 16, 2023
1 parent 0fa02b3 commit b032b83
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 0 deletions.
12 changes: 12 additions & 0 deletions neo4j/neo4j-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: neo4j-secret
namespace: neo4j-namespace
# NEO4J_AUTH being username/password -needed for DB-Startup
data:
NEO4J_AUTH: bmVvNGovMTIzNDU2Nzg= #neo4j/12345678
NEO4J_SERVER_PASSWORD: MTIzNDU2Nzg= #12345678
NEO4J_SERVER_USER: bmVvNGo= #neo4j
type: Opaque

86 changes: 86 additions & 0 deletions neo4j/neo4j4-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
apiVersion: v1
kind: Service
metadata:
namespace: neo4j-namespace
name: neo4j-service
spec:
type: NodePort
ports:
- port: 7474
name: neo4j-port
nodePort: 30074
- port: 7687
name: bolt-port
nodePort: 30087
selector:
app.kubernetes.io/name: neo4j-database
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: neo4j-namespace
name: neo4j-database
labels: &LABELS
app.kubernetes.io/name: neo4j-database
app.kubernetes.io/component: database
spec:
selector:
matchLabels:
app.kubernetes.io/name: neo4j-database
serviceName: neo4j-service
replicas: 1
template:
metadata:
labels: *LABELS
spec:
initContainers:
# use init container to copy APOC to plugins directory
- name: neo4j-apoc-init
image: neo4j:4.4.22
command: [ '/bin/sh', '-c', 'cp -v /var/lib/neo4j/labs/apoc-4.4.0.19-core.jar /var/lib/neo4j/plugins/apoc-4.4.0.19-core.jar' ]
volumeMounts:
- name: neo4j-plugins
mountPath: /var/lib/neo4j/plugins
containers:
- name: neo4j
image: neo4j:4.4.22
ports:
- containerPort: 7474
name: neo4j-port
- containerPort: 7687
name: bolt-port
env:
- name: NEO4J_server_bolt_advertised_address
value: 'localhost:30087'
- name: NEO4J_dbms_security_procedures_allowlist
value: 'apoc.export.graphml.*,apoc.import.graphml'
- name: NEO4J_apoc_export_file_enabled
value: 'true'
- name: NEO4J_apoc_import_file_enabled
value: 'true'
volumeMounts:
- name: neo4j-data
mountPath: /data
- name: neo4j-backup
mountPath: /var/lib/neo4j/backup
- name: neo4j-plugins
mountPath: /var/lib/neo4j/plugins
resources:
limits:
cpu: 1000m # 2 cpu
memory: 2Gi
requests:
cpu: 50m # 1/20 cpu
memory: 1Gi
volumes:
- name: neo4j-plugins
persistentVolumeClaim:
claimName: neo4j4-neo4j-plugins
- name: neo4j-data
persistentVolumeClaim:
claimName: neo4j4-neo4j-data
- name: neo4j-backup
persistentVolumeClaim:
claimName: neo4j4-neo4j-backup

89 changes: 89 additions & 0 deletions neo4j/neo4j5-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
apiVersion: v1
kind: Service
metadata:
namespace: neo4j-namespace
name: neo4j-service
spec:
type: NodePort
ports:
- port: 7474
name: neo4j-port
nodePort: 30074
- port: 7687
name: bolt-port
nodePort: 30087
selector:
app.kubernetes.io/name: neo4j-database
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: neo4j-namespace
name: neo4j-database
labels: &LABELS
app.kubernetes.io/name: neo4j-database
app.kubernetes.io/component: database
spec:
selector:
matchLabels:
app.kubernetes.io/name: neo4j-database
serviceName: neo4j-service
replicas: 1
template:
metadata:
labels: *LABELS
spec:
initContainers:
# use init container to copy APOC to plugins directory
- name: neo4j-apoc-init
image: neo4j:5.12.0
command: [ '/bin/sh', '-c', 'cp -v /var/lib/neo4j/labs/apoc-5.12.0-core.jar /var/lib/neo4j/plugins/apoc-5.12.0-core.jar' ]
volumeMounts:
- name: neo4j-plugins
mountPath: /var/lib/neo4j/plugins
containers:
- name: neo4j
image: neo4j:5.12.0
ports:
- containerPort: 7474
name: neo4j-port
- containerPort: 7687
name: bolt-port
envFrom:
- secretRef:
name: neo4j-secret
env:
- name: NEO4J_dbms_security_procedures_allowlist
value: 'apoc.export.graphml.*,apoc.import.graphml'
- name: NEO4J_apoc_export_file_enabled
value: 'true'
- name: NEO4J_apoc_import_file_enabled
value: 'true'
- name: NEO4J_server_config_strict__validation_enabled
value: 'false'
volumeMounts:
- name: neo4j-data
mountPath: /data
- name: neo4j-backup
mountPath: /var/lib/neo4j/backup
- name: neo4j-plugins
mountPath: /var/lib/neo4j/plugins
resources:
limits:
cpu: 1000m # 2 cpu
memory: 2Gi
requests:
cpu: 50m # 1/20 cpu
memory: 1Gi
volumes:
- name: neo4j-plugins
persistentVolumeClaim:
claimName: neo4j5-neo4j-plugins
- name: neo4j-data
persistentVolumeClaim:
claimName: neo4j5-neo4j-data
- name: neo4j-backup
persistentVolumeClaim:
claimName: neo4j5-neo4j-backup

0 comments on commit b032b83

Please sign in to comment.