Skip to content

Commit 958aa9f

Browse files
authored
Merge pull request #768 from MetaCell/feature/CH-32
Neo4J browser
2 parents f8bf3b2 + 9f5130f commit 958aa9f

9 files changed

Lines changed: 128 additions & 3 deletions

File tree

applications/neo4j/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
helm-charts

applications/neo4j/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Neo4j browser helm chart
2+
3+
Enable this application to deploy a Neo4j server with the neo4j browser enabled.
4+
5+
## How to use
6+
The neo4j browser will be enabled at neo4j.[DOMAIN].
7+
8+
![Neo4j browser login](docs/browser-login.png)
9+
10+
The default credentials are set in the [application configuration file](deploy/values.yaml).
11+
12+
It is recommended to change the password during the first login, such as:
13+
14+
```
15+
ALTER USER default SET PASSWORD '<new-password>'
16+
```
17+
18+
## Implementation
19+
This implementation uses the Neo4j reverse proxy server to enable usage via Ingress and http(s).
20+
21+
For more information, see https://neo4j.com/docs/operations-manual/current/kubernetes/accessing-neo4j-ingress/
22+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Values.apps.neo4j.harness.deployment.name }}
5+
labels:
6+
app: {{ .Values.apps.neo4j.harness.deployment.name }}
7+
namespace: "{{ .Release.Namespace }}"
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: {{ .Values.apps.neo4j.harness.deployment.name }}
13+
template:
14+
metadata:
15+
name: {{ .Values.apps.neo4j.harness.deployment.name }}
16+
labels:
17+
name: {{ .Values.apps.neo4j.harness.deployment.name }}
18+
app: {{ .Values.apps.neo4j.harness.deployment.name }}
19+
spec:
20+
securityContext: {{ toYaml .Values.apps.neo4j.reverseProxy.podSecurityContext | nindent 8 }}
21+
containers:
22+
- name: {{ .Values.apps.neo4j.harness.deployment.name }}
23+
image: {{ .Values.apps.neo4j.reverseProxy.image }}
24+
imagePullPolicy: Always
25+
securityContext: {{ toYaml .Values.apps.neo4j.reverseProxy.containerSecurityContext | nindent 12 }}
26+
ports:
27+
- containerPort: {{ .Values.apps.neo4j.harness.deployment.port }}
28+
env:
29+
- name: SERVICE_NAME
30+
value: {{ .Values.apps.neo4j.harness.database.name }}
31+
- name: PORT
32+
value: {{ .Values.apps.neo4j.harness.deployment.port | quote }}
33+
- name: DOMAIN
34+
value: {{ .Values.apps.neo4j.reverseProxy.domain | default "cluster.local" }}
35+
- name: NAMESPACE
36+
value: {{ .Release.Namespace }}
37+
---
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
harness:
2+
subdomain: neo4j
3+
database:
4+
auto: true
5+
name: neo4j-db
6+
type: neo4j
7+
user: default
8+
pass: default
9+
deployment:
10+
auto: false
11+
service:
12+
auto: true
13+
# Parameters for reverse proxy
14+
reverseProxy:
15+
image: "neo4j/helm-charts-reverse-proxy:5.23"
16+
17+
# Name of the kubernetes service. This service should have the ports 7474 and 7687 open.
18+
# This could be the admin service ex: "standalone-admin" or the loadbalancer service ex: "standalone" created via the neo4j helm chart
19+
# serviceName , namespace , domain together will form the complete k8s service url. Ex: standalone-admin.default.svc.cluster.local
20+
# When used against a cluster ensure the service being used is pointing to all the cluster instances.
21+
# This could be the loadbalancer from neo4j helm chart or the headless service installed via neo4j-headless-service helm chart
22+
serviceName: ""
23+
# default is set to cluster.local
24+
domain: "cluster.local"
25+
26+
# securityContext defines privilege and access control settings for a Container. Making sure that we dont run Neo4j as root user.
27+
containerSecurityContext:
28+
allowPrivilegeEscalation: false
29+
runAsNonRoot: true
30+
runAsUser: 7474
31+
runAsGroup: 7474
32+
capabilities:
33+
drop:
34+
- all
35+
36+
podSecurityContext:
37+
runAsNonRoot: true
38+
runAsUser: 7474
39+
runAsGroup: 7474
40+
fsGroup: 7474
41+
fsGroupChangePolicy: "Always"
24.5 KB
Loading

deployment-configuration/helm/templates/auto-database-neo4j.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
value: {{ .app.harness.database.neo4j.memory.heap.max }}
2222
- name: NEO4J_dbms_security_auth__enabled
2323
value: {{ .app.harness.database.neo4j.dbms_security_auth_enabled | quote }}
24+
- name: NEO4J_auth
25+
value: {{ .app.harness.database.user }}/{{ .app.harness.database.pass }}
2426
{{- end }}

deployment-configuration/helm/templates/auto-database.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ metadata:
102102
app: {{ .app.harness.deployment.name | quote }}
103103
{{ include "deploy_utils.labels" .root | indent 4 }}
104104
spec:
105-
type: ClusterIP
105+
type: {{ if .app.harness.database.expose }}LoadBalancer{{ else }}ClusterIP{{ end }}
106106
selector:
107107
app: {{ .app.harness.database.name | quote }}
108108
ports:

deployment-configuration/value-template.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ harness:
7575
pass: metacell
7676
# -- image ref for referencing images from the build, e.g. image_ref: myownpgimage
7777
image_ref:
78+
# -- expose database to the public with ingress
79+
expose: false
7880
# -- settings for mongo database (for type==mongo)
7981
mongo:
8082
image: mongo:5
@@ -90,7 +92,7 @@ harness:
9092
port: 5432
9193
# -- settings for neo4j database (for type==neo4j)
9294
neo4j:
93-
image: neo4j:4.1.9
95+
image: neo4j:5
9496
memory:
9597
size: 256M
9698
pagecache:

docs/applications/databases.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ harness:
3535

3636
`image_ref`: Optional setting, used for referencing a base/static image from the build. The complete image name with tag will automagically being generated from the values.yaml file. This setting overrides the `image` setting specific for the database type (e.g. postgres/image). Note: the referenced image must be included as a build dependency in order to be built by the pipelines.
3737

38+
`expose`: This option allows you to expose the database port through a load balancer.
39+
Do not use on production!
40+
3841

3942
### Specific database settings
4043

@@ -91,7 +94,24 @@ harness
9194

9295
#### Neo4j
9396

94-
Not yet supported!
97+
Defaults:
98+
```yaml
99+
harness
100+
database:
101+
neo4j:
102+
dbms_security_auth_enabled: "false"
103+
image: neo4j:5
104+
memory:
105+
heap: { initial: 64M, max: 128M }
106+
pagecache: { size: 64M }
107+
size: 256M
108+
ports:
109+
- { name: http, port: 7474 }
110+
- { name: bolt, port: 7687 }
111+
```
112+
113+
Not that the default resource values are not optimized and increasing the default memory is recommended for production.
114+
Mapping memory configuration with Kubernetes resource requests is also recommended.
95115

96116
## Programmatic API
97117

0 commit comments

Comments
 (0)