Quickstart: Deploy a Neo4j instance to an Azure Kubernetes Service (AKS) cluster
A quick start guide for deploying a Neo4j instance to an Azure Kubernetes Service (AKS) cluster using Neo4j Helm charts.
azcommand-line interface (CLI) (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).
kubectlKubernetes client command-line tool (https://kubernetes.io/docs/tasks/tools/).
helmcommand-line tool (https://helm.sh/docs/intro/install/)
Add the neo4j Helm repository
helm repo add neo4j https://helm.neo4j.com/neo4j
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.
Verify that your Kubernetes nodes have sufficient CPU and memory for your Neo4j deployment.
We recommend using nodes with at least 4 CPUs and 4GB of memory. This size can usually fit a Neo4j instance with 1CPU and 2GB memory. For more information on Neo4j’s system requirements, see System requirements.
All the shell commands in this guide assume that the Azure Resource Group and location to use have been set using the
AZURE_DEFAULTS_GROUPenvironment variables, for example:
export AZURE_DEFAULTS_GROUP="myneo4jrg" export AZURE_DEFAULTS_LOCATION="northeurope"
If you do not have an AKS cluster, you can create a single-node one using:
You can add the necessary role assignments to the AKS cluster using:
You can configure kubectl to use your AKS cluster using
To install Neo4j, perform the following steps:
Create an Azure managed disk using the following command. This is a normal Azure managed disk and not Kubernetes specific:
az disk create --name "my-neo4j-disk" --size-gb "64" --sku Premium_LRS --max-shares 1
Fetch the ID of the disk that was just created.
az disk show --name "my-neo4j-disk" --query id
Create a new file my-neo4j.values.yaml with the following content, replacing
<disk id> with the ID of the disk you created:
neo4j: resources: cpu: "1" memory: "2Gi" # Uncomment to set the initial password #password: "my-initial-password" # Uncomment to use enterprise edition #edition: "enterprise" #acceptLicenseAgreement: "yes" volumes: data: mode: "volume" volume: azureDisk: diskName: "my-neo4j-disk" diskURI: "<disk id>" kind: Managed
For details of all Neo4j Helm Chart configuration options, see Configure and install Neo4j using a customized Helm chart.
Ensure your Helm Chart repositories are up to date:
helm repo update
Install Neo4j using the deployment values file created in Create a Helm deployment values file:
helm install my-neo4j-release neo4j/neo4j-standalone -f my-neo4j.values.yamlExample output
NAME: my-neo4j-release LAST DEPLOYED: Wed Jul 7 19:52:58 2021 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Thank you for installing neo4j-standalone. Your release "my-neo4j-release" has been installed . To view the progress of the rollout try: $ kubectl rollout status --watch --timeout=600s statefulset/my-neo4j-release Once rollout is complete you can log in to Neo4j at "neo4j://my-neo4j-release.default.svc.cluster.local:7687". Try: $ kubectl run --rm -it --image "neo4j:4.3.2" cypher-shell \ -- cypher-shell -a "neo4j://my-neo4j-release.default.svc.cluster.local:7687" -u neo4j Graphs are everywhere!
kubectl rolloutcommand provided in the output of
helm installto watch the Neo4j’s rollout until it is complete.
kubectl rollout status --watch --timeout=600s statefulset/my-neo4j-release
Since you have not passed a password for the
neo4juser, the Neo4j Helm chart has set an automatically generated one. You can find it in the Helm install output. Please make a note of it.
Uninstall Neo4j Helm deployment.
helm uninstall my-neo4j-release
release "my-neo4j-release" uninstalled
Uninstalling the Helm release does not remove the Azure managed disk, nor does it remove the data it contains:
az disk show --name "my-neo4j-disk"
If you re-create Neo4j with the same settings, it will pick up the same disk again and all the data will still be on it.
Even if you delete the AKS cluster, the managed disk with the Neo4j data will still exist. Note that the disk will be deleted if its Resource Group is deleted.
After uninstalling the helm deployment, the only remaining step is to delete the managed disk.
Delete the Azure managed disk:
az disks delete --name "my-neo4j-disk"
If you are sure that you want to delete the entire AKS Kubernetes cluster, run:
Was this page helpful?