Complete Guide to Neo4j APOC Plugin Installation on Kubernetes using Helm Chart
Introduction (APOC):
The APOC (Awesome Procedures on Cypher) plugin is an extension for Neo4j that enhances its functionality by providing a wide range of additional procedures and functions. It extends the capabilities of the Cypher query language, allowing users to perform complex operations and data manipulations that are not natively available in Neo4j. The APOC plugin offers a vast collection of procedures and functions for tasks such as data import/export, data transformation, graph algorithms, text processing, temporal operations, and more. It simplifies complex operations and enables users to leverage powerful features without having to write custom code. Together, they form a powerful combination for working with graph data.
Prerequisites:
- Start by cloning or downloading the Neo4j Helm chart repository from the following link: Helm repo link
- Example git clone <above repo link>
- Create a Kubernetes cluster using any of the following methods:
- Managed Kubernetes Service: Cloud providers like AWS, GCP, and Azure offer managed Kubernetes services (EKS, GKE, AKS) for easy cluster creation. Refer to their documentation for instructions.
- Minikube: Use Minikube to set up a local development cluster. Follow the official Minikube documentation for installation and configuration.
- Kubeadm: Set up a Kubernetes cluster on your infrastructure manually using kubeadm. Consult the Kubernetes documentation for detailed instructions.
- Once your cluster is ready, ensure you're connected using the appropriate command or configuration.
Changes required in Helm Chart To install APOC plugin:
1. Add dbms.security.procedures.unrestricted="apoc.*" in helm-charts/neo4j/neo4j-community.conf. You can search for dbms.security.procedures.allowlist=apoc.coll.*, apoc.load.*, gds.* in the neo4j-community.conf file and add the above line after that.
2. Add APOC related environment variables in helm-charts/neo4j/values.yaml. For example, to enable exporting or generating a JSON file of the data stored in Neo4j and uploading the JSON file to ingest data to Neo4j:
apoc config:
apoc.export.file.enabled: "true"
apoc.import.file.enabled: "true"
3. Add NEO4J_PLUGINS: '["apoc"]' in the data block of helm-charts/neo4j/templates/neo4j-env.yaml:
data:
NEO4J_PLUGINS: '["apoc"]'
Deploy Helm Chart inside Kubernetes namespace
- Create a Kubernetes namespace:
kubectl create namespace neo4j - Install the Helm chart:
helm install <release_name> <path_of_neo4j_helm_directory> --namespace
neo4j -f values.yaml
Verify the Tasks:
After successfully deploying the Neo4j Helm chart with the APOC plugin, you can verify the installation and ensure that the plugin is functioning as expected. Here are some steps to perform the verification:
- Access the Neo4j browser by using the appropriate URL and credentials.
- In the Neo4j browser, execute a sample APOC procedure, such as importing data from an external CSV file using the
apoc.load.csvprocedure. - Run some graph algorithms provided by APOC to analyze and process the graph data.
- Perform a data export using APOC procedures and verify the exported data for correctness.
- Test any custom procedures that you may have added to the APOC plugin.
By following these steps, you can ensure that the APOC plugin is properly installed and functioning as intended. If you encounter any issues or errors, double-check the installation steps and configurations to rectify the problem.
