Prerequisites
Before you can deploy a Neo4j standalone instance on Kubernetes, you need to:
General prerequisites
-
Obtain a valid license if you want to install Neo4j Enterprise Edition or set the configuration parameters
edition: "enterprise"
to"eval"
if you want to accept the Neo4j evaluation license. The Neo4j Community Edition (default for the standalone chart) does not require a license.
For more information on how to obtain a commercial license, see https://neo4j.com/licensing/ and link:https://neo4j.com/terms/licensing/, or use the form Contact Neo4j. -
Install the Kubernetes client command-line tool
kubectl
(https://kubernetes.io/docs/tasks/tools/). -
Set up a Kubernetes cluster with sufficient CPU and memory for your Neo4j deployment.
This guide works with minimum CPU and memory allocated per Neo4j instance. However, the Neo4j system requirements largely depend on the use of the software. Therefore, for running Neo4j in development or production environments, please refer to System requirements.
If you do not have a Kubernetes cluster, you can configure a single-node one as per your environment, see the next section Environment-specific prerequisites.
Environment-specific prerequisites
Select the tab as per your Kubernetes environment and complete all prerequisites on it.
-
Install the
gcloud
command-line interface (CLI) (https://cloud.google.com/sdk/docs/install). -
All the shell commands in this guide assume that the GCP Project, compute zone, and region to use have been set using the
CLOUDSDK_CORE_PROJECT
,CLOUDSDK_COMPUTE_ZONE
, andCLOUDSDK_COMPUTE_REGION
environment variables, for example:export CLOUDSDK_CORE_PROJECT="my-neo4j-project" export CLOUDSDK_COMPUTE_ZONE="europe-west2-a" export CLOUDSDK_COMPUTE_REGION="europe-west2"
-
If you do not have a Google Kubernetes Engine (GKE) cluster, you can create a single-node one using:
gcloud container clusters create my-neo4j-gke-cluster --num-nodes=1 --machine-type "e2-standard-2"
e2-standard-2 is the minimum instance type required for running the examples of this startup guide on GKE.
-
Configure
kubectl
to use your GKE cluster using:gcloud container clusters get-credentials my-neo4j-gke-cluster
Fetching cluster endpoint and auth data. kubeconfig entry generated for my-neo4j-gke-cluster.
-
Install the
aws
command-line interface (CLI) (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html). Make sure you complete the AWS configuration step (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html). -
Install the
eksctl
command-line interface (CLI) (https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html). -
All the shell commands in this guide assume that the AWS region to use has been set using the
AWS_DEFAULT_REGION
environment variable, for example:export AWS_DEFAULT_REGION="eu-west-1"
-
If you do not have an AWS Elastic Kubernetes Service (EKS) cluster, you can create a single-node one using the following command:
This command requires that you have a public key named id_rsa.pub. If you do not have one, you can generate it by running:
ssh-keygen -t rsa -C "your-name@example.com"
eksctl create cluster --name "my-neo4j-eks-cluster" --region "${AWS_DEFAULT_REGION}" --nodegroup-name "neo4j-nodes" --nodes-min 1 --nodes-max 2 --node-type c4.xlarge --nodes 1 --node-volume-size 10 --ssh-access --with-oidc
-
Create an IAM role (e.g.,
AmazonEKS_EBS_CSI_DriverRole
) and attach the required AWS-managed policy to it (e.g.,AmazonEBSCSIDriverPolicy
).eksctl create iamserviceaccount \ --name ebs-csi-controller-sa \ --namespace kube-system \ --cluster my-neo4j-eks-cluster \ --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \ --approve \ --role-only \ --role-name AmazonEKS_EBS_CSI_DriverRole
-
Add the EBS CSI Driver as an Amazon EKS add-on to your cluster:
eksctl create addon \ --name aws-ebs-csi-driver \ --cluster my-neo4j-eks-cluster \ --service-account-role-arn arn:aws:iam::<aws-account-id>:role/AmazonEKS_EBS_CSI_DriverRole \ --force
Make sure to replace
<aws-account-id>
with your AWS account ID. -
Configure
kubectl
to use your EKS cluster using:aws eks update-kubeconfig --name my-neo4j-eks-cluster
-
Install the
az
command-line interface (CLI) (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). -
Verify that you have a Resource Group with:
-
An Azure Kubernetes Service (AKS) cluster.
-
The AKS cluster principal needs to be assigned roles that allow it to manage Microsoft.Compute/disks in the Resource Group.
-
-
Set the Resource group and the location to use as defaults using:
az configure --defaults group=<MyResourceGroup> az configure --defaults location=<MyAzureLocation>
-
If you do not have an AKS cluster, follow the steps to create a single-node one.
-
Create a cluster by running:
az aks create --name my-neo4j-aks-cluster --node-count=1
-
Configure
kubectl
to use your AKS cluster using:az aks get-credentials --name my-neo4j-aks-cluster --admin
-
-
Install Docker Desktop for macOS. For more information, see Docker official documentation.
-
Enable the Docker Desktop Kubernetes engine. For more information, see Docker official documentation.
-
Verify that you do not have a running instance of Neo4j (e.g., via Neo4j Desktop or Neo4j Browser) to avoid port clashes.