<p><p></p><p>This is a follow up from <a href="https://lab.datak.biz/blog/detail/66/" target="_blank">previous blog</a> for neo4j helm deployment at k8s.</p><p><br></p><h2>Debugging</h2><p>Following script will typically find a container related issues</p><p>1. Typical overall log from pod</p><pre>#shell kubectl describe pod <your pod name></pre><p>2. Typical detail log from pod</p><pre>#shell kubectl logs <your pod name></pre><p>3. Neo4j specific event log</p><pre>#shell kubectl exec <your pod name> -- tail -n50 /logs/neo4j.log</pre><p>4. If pod is running you can look into container inside by;</p><pre>#shell kubectl exec -it <your pod name> -- bash</pre><p>which is similar to `docker exec -it <container id> bin/bash`</p><p><br></p><h2>How to use secret repository</h2><p><a href="https://neo4j.com/docs/operations-manual/current/kubernetes/maintenance/#imagepullsecrets" target="_blank">Reference</a><br></p><pre>#neo4j config.yaml image: imagePullSecrets: - "secret name" #if you are not using k8s platform app to create a secret imageCredentials: - registry: "address" username: "" password: "" email: "" name: ""</pre><h2>How to add plugins/create customized container</h2><p>Note, neo4j helm has neo4j container compatibility, neo4j docker version >4.3.0. My workable solution is following <a href="https://neo4j.com/docs/operations-manual/current/kubernetes/configuration/#custom-container" target="_blank">the neo4j doc</a>.<br><br>1. Create personalized dockerfile based on neo4j official docker<br></p><pre>#dockerfile FROM neo4j:<version >4.3.0> ########################## #proxy settings #environmental setting for proxy when the container run ENG http_proxy "proxy URL" #configure proxy in apt RUN echo '\ Acquire::http::proxy "proxy URL" ' > /etc/apt/apt.conf ########################## #environmental settings for neo4j configurations ENV NEO4J_ACCEPT_LICENSE_AGREEMENT=yes ENV NEO4J_AUTH=neo4j/<your neo4j login password here for basic auth> ENV apoc.import.file.enabled=true ENV apoc.export.file.enabled=true ENV apoc.export.json.all=true #install plugins ENV NEO4JLABS_PLUGINS='["apoc","graph-data-science","bloom"]'</pre><p>2. Push the image to the repository by;<br></p><pre>#shell docker build .. docker push ..</pre>3.Add the repo and image name in config.yaml. <span style="background-color: rgb(255, 255, 0);">Note that if you change docker image and push to the repo, you need to change the tag, otherwise helm will not reflect the changes</span></p><p><span style="background-color: rgb(255, 255, 0);">Also another note that you will need to disable couple of security so the plugins can access the neo4j databse<br></span><p></p><p></p><pre>#config.yaml image: customImage: "<registry URL>/<namespace>/<image>/<tag>" imagePullSecrets: - <secret name> #enable that plugins can access to the database config: dbms.config.strict_validation: "fase" dbms.security.procedures.unrestricted: "apoc.*" dbms.security.procedures.unrestricted: "bloom.*" dbms.unmanaged_extension_classes: "com.neo4j.bloom.server=/browser/bloom"</pre>4. Upgrade helm chart. It would be safe to use same version from helm (neo4h helm version is same as neo4j docker version)<br><pre>#shell helm upgrade <your helm name> neo4j/neo4j-standalone --version <version> --set volumes.data.mode=defaultStorageClass -f config.yaml</pre>5. Check helm version<br><pre>#shell helm list</pre><p><br></p><h2>How to add license</h2><p><br></p><p><br></p><h2>How to create a persistent storage</h2><p>Just follow volume settings in `config.yaml` and `helm upgrade` in previous blog, and that will automatically created persistent storage. For Rancher, it will automatically mount and for local minikube it will create new directory under home</p><p><br></p><p></p></p>
<< Back to Blog Posts
Back to Home