neo4j-community

by Helm

Helm chartv1.2.5App 4.2.4

Neo4j is the world's leading graph database

About this chart

Neo4j

This chart is based on the official neo4j enterprise helm chart, modified to deploy a single-instance neo4j-community deployment.

Neo4j is a highly scalable native graph database that leverages data relationships as first-class entities, helping enterprises build intelligent applications to meet today’s evolving data challenges.

TL;DR;

helm repo add equinor-charts https://equinor.github.io/helm-charts/charts/
helm repo update
helm upgrade --install neo4j-community equinor-charts/neo4j-community

Introduction

This chart bootstraps a Neo4j deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Helm 3
  • Kubernetes 1.6+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name neo4j-community:

helm upgrade --install neo4j-community equinor-charts/neo4j-community --set acceptLicenseAgreement=yes --set neo4jPassword=mySecretPassword

You must explicitly accept the neo4j license agreement for the installation to be successful.

The command deploys Neo4j on the Kubernetes cluster in the default configuration but with the password set to mySecretPassword. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the neo4j-community deployment:

helm delete neo4j-community

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Neo4j chart and their default values.

ParameterDescriptionDefault
imageNeo4j imageneo4j
imageTagNeo4j version{VERSION}
imagePullPolicyImage pull policyIfNotPresent
nodeSelectorPod node selector{}
tolerationsPod tolerations[]
affinityPod affinity{}
authEnabledIs login/password required?true
neo4jPasswordPassword to log in the Neo4J database if password is required(random string of 10 characters)
existingPasswordSecretSecret name containing the password for neo4j user``
existingPasswordSecretKeykey in existingPasswordSecret, in which the password is contained``
persistentVolume.enabledWhether or not persistence is enabledtrue
persistentVolume.mountPathPersistent Volume mount root path/data
persistentVolume.sizeSize of data volume10Gi
persistentVolume.storageClassStorage class of backing PVCstandard (uses beta storage class annotation)
persistentVolume.subPathSubdirectory of the volume to mountnil
extraVarsExtra environment variables to setnil
sideCarContainersSidecar containers to add to the core pod. Example use case is a sidecar which identifies and labels the leader when using the http API[]
initContainersInit containers to add to the core pod. Example use case is a script that installs the APOC library[]
resourcesResources required (e.g. CPU, memory){}
service.typeType of the serviceClusterIP
service.annotationsAnnotations to be added to service{}
service.labelsLabels to be added to service{}
service.loadBalancerSourceRangesTraffic through the load-balancer will be restricted to the specified client IPs (for service.type: LoadBalancer)[]
rbac.createWhether to create RBAC for Neo4jfalse
serviceAccount.createWhether to create service account of Neo4jtrue
serviceAccount.annotationsAnnotations to be added to service account{}
serviceAccount.nameService account name``
podLabelsLabels to be added to pods{}
podAnnotationsAnnotations to be added to pods{}
additionalVolumesAdditional volumes to mount in the Neo4j container[]
additionalVolumeMountsWhere the additional volumes are mounted in the Neo4j container[]
terminationGracePeriodSecondsDuration in seconds the pod needs to terminate gracefully300
readinessProbe.initialDelaySecondsNumber of seconds after the container has started before probes are initiated60
readinessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded3
readinessProbe.timeoutSecondsNumber of seconds after which the probe times out2
readinessProbe.periodSecondsHow often (in seconds) to perform the probe10
readinessProbe.tcpSocket.portTCP check against the pod's IP address on a specified port7687
livenessProbe.initialDelaySecondsNumber of seconds after the container has started before probes are initiated120
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded3
livenessProbe.timeoutSecondsNumber of seconds after which the probe times out2
livenessProbe.periodSecondsHow often (in seconds) to perform the probe10
livenessProbe.tcpSocket.portTCP check against the pod's IP address on a specified port7687
securityContextSecurity context to be added to pods{}
env.JMXPORTPort for jmxremote rmi port1099
exporters.jmxConfiguration for jmx exporter for Prometheus (disabled by default)see values.yaml

The above parameters map to the env variables defined in the Neo4j docker image.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm upgrade --install neo4j-community equinor-charts/neo4j-community

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

helm upgrade --install neo4j-community -f values.yaml equinor-charts/neo4j-community

Tip: You can use the default values.yaml

Updating password

We can indeed reset that password without having to delete the PVC by:

  1. Deleting the file /var/lib/neo4j/data/dbms/auth
  2. Running neo4j-admin set-initial-password <new password>
  3. Changing the password in the configured secret.
  4. Deleting the pod to restart and pick up the latest configuration

Special considerations when using AzureFile storage

If you want to use AzureFile you need to create a StorageClass with the neo4j user uid&gid in mount options:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile-neo4j
provisioner: kubernetes.io/azure-file
reclaimPolicy:

Deploy neo4j-community with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has neo4j-community on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartneo4j-community is pinned at v1.2.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply