Home » DevOps » Deploying a Neo4J single core on managed Kubernetes

About Sebastian Daschner

Sebastian Daschner
Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.

Deploying a Neo4J single core on managed Kubernetes

Besides running a database cluster, it might already be sufficient for your project to deploy a single instance. In the following video I’ll explain how to deploy a single core Neo4J instance using Helm to a managed Kubernetes cluster.

I’ll be using a forked and modified version of the official Helm chart, which you can find in this GitHub repository branch.

The shows example Helm chart got rid of the discovery mechanisms which are not required and some other Kubernetes resources, so the resulting deployment is simpler compared to the cluster version I showed previously.

Try it yourself

Similar to the cluster version, you can try this out yourself by deploying on a managed Kubernetes environment. If you need access to a Kubernetes cluster, you can follow this guide to get started on IKS. You will need Helm in version v3.x.

cd /tmp/
git clone https://github.com/sdaschner/neo4j-helm --branch single-instance
cd neo4j-helm/
helm template graphdb \
  --set acceptLicenseAgreement=yes \
  --set neo4jPassword=mySecretPassword . \
  > /tmp/neo4j.yaml
kubectl apply -f /tmp/neo4j.yaml

With that, Kubernetes will provision the resources including the volume claim and your cloud provider will create the persistent volume.

kubectl get pvc
NAME                           STATUS   [...]  STORAGECLASS     AGE
datadir-graphdb-neo4j-core-0   Pending         ibmc-file-gold   13s

After a while your persistent volumes will be provisioned:

kubectl get pvc
NAME                           STATUS   VOLUME               STORAGECLASS     AGE
datadir-graphdb-neo4j-core-0   Bound    pvc-8c0ae307-[...]   ibmc-file-gold   2m24s

Once that is the case, the single Neo4J pod provided by the stateful set should be up-and-running:

kubectl get pods
NAME                               READY   STATUS    RESTARTS   AGE
graphdb-neo4j-core-0               1/1     Running   0          4m13s

Testing the connection, and running the example coffee beans application is similar to the cluster version. Here, we only have the core-0 instance available, which is also accessed from the graphdb-neo4j service, or directly via port-forward for debugging purposed, as shown previously.

Happy Neo4J graph databasing!

Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: Deploying a Neo4J single core on managed Kubernetes (Video)

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments