Repository navigation
Neo4j Docs Update #1055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,563
−16
Merged
Neo4j Docs Update #1055
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5525837
Neo4j Docs Update
fr-sarker 6bc93bc
added link of metrics server
fr-sarker 5ebaaf2
update
fr-sarker b6897c3
add composite database backup/restore docs
fr-sarker 1f91f66
modify link
fr-sarker c84821b
updated
fr-sarker cb1c2d5
refactor yaml
fr-sarker 278cc3f
add neo4j pitr docs
fr-sarker 1737f72
updated
fr-sarker 29d895e
updated
fr-sarker d1d7b07
Fix Neo4j KubeStash logical backup overview link
fr-sarker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
docs/examples/neo4j/autoscaler/compute/neo4j-compute-autoscaler.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| apiVersion: autoscaling.kubedb.com/v1alpha1 | ||
| kind: Neo4jAutoscaler | ||
| metadata: | ||
| name: neo4j-compute-autoscaler | ||
| namespace: demo | ||
| spec: | ||
| databaseRef: | ||
| name: neo4j-autoscale | ||
| opsRequestOptions: | ||
| apply: IfReady | ||
| timeout: 10m | ||
| maxRetries: 3 | ||
| compute: | ||
| neo4j: | ||
| trigger: "On" | ||
| podLifeTimeThreshold: 5m | ||
| resourceDiffPercentage: 20 | ||
| minAllowed: | ||
| cpu: 600m | ||
| memory: 1200Mi | ||
| maxAllowed: | ||
| cpu: "2" | ||
| memory: 2Gi | ||
| controlledResources: | ||
| - cpu | ||
| - memory | ||
| containerControlledValues: RequestsAndLimits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| apiVersion: kubedb.com/v1alpha2 | ||
| kind: Neo4j | ||
| metadata: | ||
| name: neo4j-autoscale | ||
| namespace: demo | ||
| spec: | ||
| version: "2025.12.1" | ||
| replicas: 3 | ||
| storageType: Durable | ||
| storage: | ||
| storageClassName: longhorn | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| podTemplate: | ||
| spec: | ||
| containers: | ||
| - name: neo4j | ||
| resources: | ||
| requests: | ||
| cpu: 500m | ||
| memory: 1Gi | ||
| limits: | ||
| cpu: 500m | ||
| memory: 1Gi | ||
| deletionPolicy: WipeOut |
18 changes: 18 additions & 0 deletions
18
docs/examples/neo4j/autoscaler/storage/neo4j-storage-autoscaler.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: autoscaling.kubedb.com/v1alpha1 | ||
| kind: Neo4jAutoscaler | ||
| metadata: | ||
| name: neo4j-storage-autoscaler | ||
| namespace: demo | ||
| spec: | ||
| databaseRef: | ||
| name: neo4j-autoscale | ||
| opsRequestOptions: | ||
| apply: IfReady | ||
| timeout: 10m | ||
| maxRetries: 3 | ||
| storage: | ||
| neo4j: | ||
| trigger: "On" | ||
| usageThreshold: 20 | ||
| scalingThreshold: 50 | ||
| expansionMode: Online |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Autoscaling | ||
| menu: | ||
| docs_{{ .version }}: | ||
| identifier: neo4j-autoscaling | ||
| name: Autoscaling | ||
| parent: neo4j-guides | ||
| weight: 90 | ||
| menu_name: docs_{{ .version }} | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Compute Autoscaling | ||
| menu: | ||
| docs_{{ .version }}: | ||
| identifier: neo4j-compute-autoscaling | ||
| name: Compute Autoscaling | ||
| parent: neo4j-autoscaling | ||
| weight: 10 | ||
| menu_name: docs_{{ .version }} | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,205 @@ | ||
| --- | ||
| title: Autoscale Neo4j Compute Resources | ||
| menu: | ||
| docs_{{ .version }}: | ||
| identifier: neo4j-compute-autoscaling-guide | ||
| name: Autoscale Compute Resources | ||
| parent: neo4j-compute-autoscaling | ||
| weight: 20 | ||
| menu_name: docs_{{ .version }} | ||
| section_menu_id: guides | ||
| --- | ||
|
|
||
| > New to KubeDB? Please start [here](/docs/README.md). | ||
|
|
||
| # Autoscale Neo4j Compute Resources | ||
|
|
||
| This guide deploys a Neo4j cluster, loads a small social graph, and configures KubeDB to adjust CPU and memory automatically. After scaling, we query the graph again to verify that the data remains available. | ||
|
|
||
| ## Before You Begin | ||
|
|
||
| | Requirement | Details | | ||
| |---|---| | ||
| | KubeDB | Provisioner, Ops Manager, and Autoscaler operators must be installed. | | ||
| | Metrics Server | The Kubernetes Metrics Server must be running so the recommender can observe pod usage. | | ||
| | Storage | This example uses a `longhorn` StorageClass; substitute another available class if necessary. | | ||
| | Tools | `kubectl`, `jq`, and `base64` must be available locally. | | ||
|
|
||
| See [Neo4jAutoscaler](/docs/guides/neo4j/concepts/autoscaler.md) and the [compute autoscaling overview](/docs/guides/neo4j/autoscaler/compute/overview.md) for background. | ||
|
|
||
| ## Deploy Neo4j | ||
|
|
||
| Create an isolated namespace and apply the example Neo4j resource: | ||
|
|
||
| ```bash | ||
| $ kubectl create namespace demo | ||
| namespace/demo created | ||
|
|
||
| $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/neo4j/autoscaler/neo4j.yaml | ||
| neo4j.kubedb.com/neo4j-autoscale created | ||
| ``` | ||
|
|
||
| Wait for the cluster to become ready: | ||
|
|
||
| ```bash | ||
| $ kubectl get neo4j -n demo neo4j-autoscale -w | ||
| NAME VERSION STATUS AGE | ||
| neo4j-autoscale 2025.12.1 Ready 3m | ||
| ``` | ||
|
|
||
| The Neo4j container initially requests and limits `500m` CPU and `1Gi` memory: | ||
|
|
||
| ```bash | ||
| $ kubectl get pod -n demo neo4j-autoscale-0 \ | ||
| -o jsonpath='{.spec.containers[?(@.name=="neo4j")].resources}' | jq . | ||
| { | ||
| "limits": {"cpu": "500m", "memory": "1Gi"}, | ||
| "requests": {"cpu": "500m", "memory": "1Gi"} | ||
| } | ||
| ``` | ||
|
|
||
| ## Create a Sample Graph | ||
|
|
||
| Read the generated admin password, create an application database, and insert users connected by `FOLLOWS` relationships: | ||
|
|
||
| ```bash | ||
| $ PASS=$(kubectl get secret -n demo neo4j-autoscale-auth \ | ||
| -o jsonpath='{.data.password}' | base64 -d) | ||
|
|
||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -u neo4j -p "$PASS" \ | ||
| "CREATE DATABASE appdb IF NOT EXISTS WAIT" | ||
|
|
||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "CREATE CONSTRAINT user_id IF NOT EXISTS | ||
| FOR (u:User) REQUIRE u.id IS UNIQUE" | ||
|
|
||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "UNWIND range(1,10000) AS i | ||
| CREATE (:User {id: i, name: 'user-' + toString(i)})" | ||
|
|
||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "UNWIND range(1,9999) AS i | ||
| MATCH (a:User {id: i}), (b:User {id: i + 1}) | ||
| CREATE (a)-[:FOLLOWS]->(b)" | ||
| ``` | ||
|
|
||
| Verify the initial graph: | ||
|
|
||
| ```bash | ||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "MATCH (u:User) RETURN count(u) AS users" | ||
| users | ||
| 10000 | ||
| ``` | ||
|
|
||
| ## Create the Neo4jAutoscaler | ||
|
|
||
| The example policy permits recommendations from `600m` to `2` CPU and from `1200Mi` to `2Gi` memory: | ||
|
|
||
| ```yaml | ||
| apiVersion: autoscaling.kubedb.com/v1alpha1 | ||
| kind: Neo4jAutoscaler | ||
| metadata: | ||
| name: neo4j-compute-autoscaler | ||
| namespace: demo | ||
| spec: | ||
| databaseRef: | ||
| name: neo4j-autoscale | ||
| opsRequestOptions: | ||
| apply: IfReady | ||
| timeout: 10m | ||
| maxRetries: 3 | ||
| compute: | ||
| neo4j: | ||
| trigger: "On" | ||
| podLifeTimeThreshold: 5m | ||
| resourceDiffPercentage: 20 | ||
| minAllowed: | ||
| cpu: 600m | ||
| memory: 1200Mi | ||
| maxAllowed: | ||
| cpu: "2" | ||
| memory: 2Gi | ||
| controlledResources: | ||
| - cpu | ||
| - memory | ||
| containerControlledValues: RequestsAndLimits | ||
| ``` | ||
|
|
||
| Apply it: | ||
|
|
||
| ```bash | ||
| $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/neo4j/autoscaler/compute/neo4j-compute-autoscaler.yaml | ||
| neo4jautoscaler.autoscaling.kubedb.com/neo4j-compute-autoscaler created | ||
| ``` | ||
|
|
||
| The minimum values are deliberately higher than the initial allocation, making this tutorial reproducible. In production, choose bounds based on workload requirements and capacity. | ||
|
|
||
| ## Observe the Recommendation and Scaling | ||
|
|
||
| Run a read workload while the recommender gathers samples: | ||
|
|
||
| ```bash | ||
| $ for i in $(seq 1 100); do | ||
| kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "MATCH (u:User)-[:FOLLOWS*1..3]->(v:User) | ||
| RETURN count(v)" >/dev/null | ||
| done | ||
| ``` | ||
|
|
||
| After the `podLifeTimeThreshold` has passed, inspect the recommendation: | ||
|
|
||
| ```bash | ||
| $ kubectl get neo4jautoscaler -n demo neo4j-compute-autoscaler \ | ||
| -o jsonpath='{.status.vpas[*].recommendation.containerRecommendations}' | jq . | ||
| ``` | ||
|
|
||
| KubeDB creates a `Neo4jOpsRequest` when the recommendation differs sufficiently from the current resources: | ||
|
|
||
| ```bash | ||
| $ kubectl get neo4jopsrequest -n demo -w | ||
| NAME TYPE STATUS AGE | ||
| neoops-neo4j-autoscale-xxxxxx VerticalScaling Successful 2m | ||
| ``` | ||
|
|
||
| Verify that the pod allocation is now within the configured bounds: | ||
|
|
||
| ```bash | ||
| $ kubectl get pod -n demo neo4j-autoscale-0 \ | ||
| -o jsonpath='{.spec.containers[?(@.name=="neo4j")].resources}' | jq . | ||
| ``` | ||
|
|
||
| The precise recommendation depends on observed usage, but it will not be below `600m` CPU and `1200Mi` memory or above `2` CPU and `2Gi` memory. | ||
|
|
||
| ## Verify the Graph | ||
|
|
||
| Confirm that the database still contains the users and relationships after the scaling rollout: | ||
|
|
||
| ```bash | ||
| $ kubectl exec -n demo neo4j-autoscale-0 -- \ | ||
| cypher-shell -d appdb -u neo4j -p "$PASS" \ | ||
| "MATCH (u:User) OPTIONAL MATCH (u)-[r:FOLLOWS]->() | ||
| RETURN count(DISTINCT u) AS users, count(r) AS follows" | ||
| users, follows | ||
| 10000, 9999 | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| - If no recommendation appears, verify Metrics Server with `kubectl top pod -n demo` and wait for more samples. | ||
| - If no OpsRequest is created, check `podLifeTimeThreshold`, `resourceDiffPercentage`, and the Autoscaler conditions. | ||
| - If an operation remains pending, describe it with `kubectl describe neo4jopsrequest -n demo <name>` and check Ops Manager logs. | ||
|
|
||
| ## Cleaning Up | ||
|
|
||
| ```bash | ||
| $ kubectl delete neo4jautoscaler -n demo neo4j-compute-autoscaler | ||
| $ kubectl delete neo4j -n demo neo4j-autoscale | ||
| $ kubectl delete namespace demo | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| title: Neo4j Compute Autoscaling Overview | ||
| menu: | ||
| docs_{{ .version }}: | ||
| identifier: neo4j-compute-autoscaling-overview | ||
| name: Overview | ||
| parent: neo4j-compute-autoscaling | ||
| weight: 10 | ||
| menu_name: docs_{{ .version }} | ||
| section_menu_id: guides | ||
| --- | ||
|
|
||
| > New to KubeDB? Please start [here](/docs/README.md). | ||
|
|
||
| # Neo4j Compute Autoscaling | ||
|
|
||
| KubeDB can automatically adjust the CPU and memory assigned to Neo4j pods. A `Neo4jAutoscaler` observes real resource usage, generates recommendations, and creates a `Neo4jOpsRequest` when the recommended resources differ sufficiently from the current allocation. | ||
|
|
||
| ## Before You Begin | ||
|
|
||
| You should be familiar with: | ||
|
|
||
| - [Neo4j](/docs/guides/neo4j/concepts/neo4j.md) | ||
| - [Neo4jAutoscaler](/docs/guides/neo4j/concepts/autoscaler.md) | ||
| - [Neo4jOpsRequest](/docs/guides/neo4j/concepts/opsrequest.md) | ||
| - [Neo4j vertical scaling](/docs/guides/neo4j/scaling/vertical-scaling/overview.md) | ||
|
|
||
| ## How Compute Autoscaling Works | ||
|
|
||
| <figure align="center"> | ||
| <img alt="Compute autoscaling process for Neo4j" src="/docs/images/neo4j/compute-autoscaling.png"> | ||
| <figcaption align="center">Fig: Neo4j compute autoscaling process</figcaption> | ||
| </figure> | ||
|
|
||
| 1. The user creates a KubeDB `Neo4j` resource. | ||
| 2. The Provisioner creates the Neo4j cluster and its supporting Kubernetes resources. | ||
| 3. The user creates a `Neo4jAutoscaler` with a `spec.compute.neo4j` policy. | ||
| 4. The Autoscaler creates and watches a Vertical Pod Autoscaler recommendation for the Neo4j container. | ||
| 5. After the pod lifetime and resource-difference thresholds are satisfied, the Autoscaler creates a `Neo4jOpsRequest` of type `VerticalScaling`. | ||
| 6. Ops Manager applies the recommendation and updates the Neo4j pods within the configured minimum and maximum bounds. | ||
|
|
||
| The next guide demonstrates this workflow end to end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: Storage Autoscaling | ||
| menu: | ||
| docs_{{ .version }}: | ||
| identifier: neo4j-storage-autoscaling | ||
| name: Storage Autoscaling | ||
| parent: neo4j-autoscaling | ||
| weight: 20 | ||
| menu_name: docs_{{ .version }} | ||
| --- |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.