diff --git a/comps/third_parties/neo4j/deployment/kubernetes/README.md b/comps/third_parties/neo4j/deployment/kubernetes/README.md new file mode 100644 index 0000000000..7b01b86a58 --- /dev/null +++ b/comps/third_parties/neo4j/deployment/kubernetes/README.md @@ -0,0 +1,14 @@ +# Deploy Neo4j on kubernetes cluster + +## Deploy on Xeon + +Step 1: Edit cpu.yaml and replace the values of the following items with the actual configurations of your system: + +- passwordFromSecret +- storageClassName + +Step 2: Run the following command + +``` +./install.sh ${release_name} $version $NS +``` diff --git a/comps/third_parties/neo4j/deployment/kubernetes/cpu.yaml b/comps/third_parties/neo4j/deployment/kubernetes/cpu.yaml new file mode 100644 index 0000000000..25bd4b1847 --- /dev/null +++ b/comps/third_parties/neo4j/deployment/kubernetes/cpu.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +neo4j: + name: "neo4j" + #passwordFromSecret: neo-creds + env: + - name: NEO4J_apoc_import_file_use__neo4j__config + value: "true" +env: + NEO4J_PLUGINS: '["apoc"]' +apoc_config: + apoc.import.file.enabled: "true" + apoc.export.file.enabled: "true" +config: + server.directories.import: "import" + dbms.security.allow_csv_import_from_file_urls: "true" + dbms.security.procedures.unrestricted: "apoc.*" + dbms.security.procedures.allowlist: "apoc.*" + server.config.strict_validation.enabled: "false" + apoc.trigger.enabled: "true" +volumes: + data: + mode: dynamic + dynamic: + storageClassName: "local-path" + accessModes: + - ReadWriteOnce + requests: + storage: 2Gi diff --git a/comps/third_parties/neo4j/deployment/kubernetes/install.sh b/comps/third_parties/neo4j/deployment/kubernetes/install.sh new file mode 100644 index 0000000000..ae6839a895 --- /dev/null +++ b/comps/third_parties/neo4j/deployment/kubernetes/install.sh @@ -0,0 +1,9 @@ +# Copyright (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +helm repo add neo4j https://helm.neo4j.com/neo4j && helm repo update # call once +release_name=${1:-graph-neo} +version=${2:-5.23.0} +NS=${3:-ogpt} +./uninstall.sh ${release_name} $NS +helm install -n $NS --version $version ${release_name} neo4j/neo4j -f cpu.yaml diff --git a/comps/third_parties/neo4j/deployment/kubernetes/uninstall.sh b/comps/third_parties/neo4j/deployment/kubernetes/uninstall.sh new file mode 100644 index 0000000000..5da34742c3 --- /dev/null +++ b/comps/third_parties/neo4j/deployment/kubernetes/uninstall.sh @@ -0,0 +1,13 @@ +# Copyright (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +release_name=${1:-graph-neo} +NS=${2:-ogpt} + +tsleep=0 +helm uninstall -n $NS ${release_name} && tsleep=5 +neo_pvc=( $(kubectl get pvc -l helm.neo4j.com/instance=${release_name} --no-headers -o custom-columns=CONTAINER:.metadata.name)) +for pvc in "${neo_pvc[@]}"; do + kubectl delete pvc $pvc +done +sleep $tsleep