Skip to content

Commit accda9e

Browse files
authored
fix(chart): add first-class Nebula graph backend values
Add first-class Helm values and API/indexing-worker env injection for Nebula graph backend credentials.
1 parent 52fb68e commit accda9e

4 files changed

Lines changed: 96 additions & 0 deletions

File tree

deploy/aperag/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,30 @@ helm install aperag ./deploy/aperag \
2424
## Environment Variables
2525

2626
All environment variables are managed through the `aperag-env` Secret. See `aperag-secret.yaml` template for configuration options.
27+
28+
## Graph Backend Values
29+
30+
The default graph backend is PostgreSQL (`api.env.GRAPH_DB_TYPE=postgresql`).
31+
For external graph stores, set the deployment default and enable the matching
32+
first-class dependency block:
33+
34+
```bash
35+
# Neo4j
36+
helm upgrade -i aperag ./deploy/aperag \
37+
--set api.env.GRAPH_DB_TYPE=neo4j \
38+
--set neo4j.enabled=true \
39+
--set neo4j.NEO4J_URI=bolt://neo4j-cluster-neo4j:7687 \
40+
--set neo4j.NEO4J_CREDENTIALS_SECRET_NAME=neo4j-cluster-neo4j-account-neo4j
41+
42+
# NebulaGraph
43+
helm upgrade -i aperag ./deploy/aperag \
44+
--set api.env.GRAPH_DB_TYPE=nebula \
45+
--set nebula.enabled=true \
46+
--set nebula.NEBULA_HOSTS=nebula-cluster-graphd:9669 \
47+
--set nebula.NEBULA_CREDENTIALS_SECRET_NAME=nebula-cluster-account-root
48+
```
49+
50+
When `*.CREDENTIALS_SECRET_NAME` is set, the API and indexing-worker
51+
Deployments read usernames and passwords from Kubernetes Secret keys
52+
`username` and `password`. The same graph backend values are injected into both
53+
Deployments so read paths and indexing write paths use the same backend.

deploy/aperag/templates/api-deployment.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,30 @@ spec:
159159
value: {{ .Values.neo4j.NEO4J_PASSWORD | default "neo4j" | quote }}
160160
{{- end }}
161161
{{- end }}
162+
{{- if .Values.nebula.enabled }}
163+
- name: NEBULA_HOSTS
164+
value: {{ .Values.nebula.NEBULA_HOSTS | quote }}
165+
- name: NEBULA_USERNAME
166+
{{- if .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
167+
valueFrom:
168+
secretKeyRef:
169+
name: {{ .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
170+
key: username
171+
{{- else }}
172+
value: {{ .Values.nebula.NEBULA_USERNAME | default "root" | quote }}
173+
{{- end }}
174+
- name: NEBULA_PASSWORD
175+
{{- if .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
176+
valueFrom:
177+
secretKeyRef:
178+
name: {{ .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
179+
key: password
180+
{{- else }}
181+
value: {{ .Values.nebula.NEBULA_PASSWORD | default "nebula" | quote }}
182+
{{- end }}
183+
- name: NEBULA_SPACE_PREFIX
184+
value: {{ .Values.nebula.NEBULA_SPACE_PREFIX | default "aperag" | quote }}
185+
{{- end }}
162186

163187
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
164188
name: aperag-api

deploy/aperag/templates/indexing-worker-deployment.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ spec:
105105
value: {{ .Values.neo4j.NEO4J_PASSWORD | default "neo4j" | quote }}
106106
{{- end }}
107107
{{- end }}
108+
{{- if .Values.nebula.enabled }}
109+
- name: NEBULA_HOSTS
110+
value: {{ .Values.nebula.NEBULA_HOSTS | quote }}
111+
- name: NEBULA_USERNAME
112+
{{- if .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
113+
valueFrom:
114+
secretKeyRef:
115+
name: {{ .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
116+
key: username
117+
{{- else }}
118+
value: {{ .Values.nebula.NEBULA_USERNAME | default "root" | quote }}
119+
{{- end }}
120+
- name: NEBULA_PASSWORD
121+
{{- if .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
122+
valueFrom:
123+
secretKeyRef:
124+
name: {{ .Values.nebula.NEBULA_CREDENTIALS_SECRET_NAME }}
125+
key: password
126+
{{- else }}
127+
value: {{ .Values.nebula.NEBULA_PASSWORD | default "nebula" | quote }}
128+
{{- end }}
129+
- name: NEBULA_SPACE_PREFIX
130+
value: {{ .Values.nebula.NEBULA_SPACE_PREFIX | default "aperag" | quote }}
131+
{{- end }}
108132
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
109133
name: aperag-indexing-worker
110134
imagePullPolicy: {{ .Values.image.pullPolicy }}

deploy/aperag/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,27 @@ neo4j:
9191
# ⚠️ Recommend to use NEO4J_CREDENTIALS_SECRET_NAME
9292
NEO4J_PASSWORD: ""
9393

94+
nebula:
95+
enabled: false # Enable/disable NebulaGraph integration (optional for graph features)
96+
# Also set api.env.GRAPH_DB_TYPE=nebula to make Nebula the default graph backend.
97+
# Comma-separated graphd endpoints, e.g. "nebula-cluster-graphd:9669".
98+
NEBULA_HOSTS: "nebula-cluster-graphd:9669"
99+
# The name of the Secret containing Nebula username and password (e.g. "username" and "password" keys).
100+
# Example: "nebula-cluster-account-root" (references your Nebula credential Secret)
101+
NEBULA_CREDENTIALS_SECRET_NAME: ""
102+
# Username and Password Priority:
103+
# 1. If NEBULA_CREDENTIALS_SECRET_NAME is set, attempts to fetch 'username' and 'password' from that Secret.
104+
# 2. If NEBULA_CREDENTIALS_SECRET_NAME is empty, uses the direct values of NEBULA_USERNAME and NEBULA_PASSWORD.
105+
# 3. If direct values are also empty, defaults to "root" / "nebula".
106+
# ⚠️ Recommend to use NEBULA_CREDENTIALS_SECRET_NAME
107+
NEBULA_USERNAME: "root"
108+
# Password (Sensitive information, strongly recommended NOT to set directly in values.yaml):
109+
# Only use this if you are NOT using NEBULA_CREDENTIALS_SECRET_NAME and accept the security implications.
110+
# ⚠️ Strongly discourage directly setting sensitive passwords here. Use Secrets for production.
111+
# ⚠️ Recommend to use NEBULA_CREDENTIALS_SECRET_NAME
112+
NEBULA_PASSWORD: "nebula"
113+
NEBULA_SPACE_PREFIX: "aperag"
114+
94115
api:
95116
dataPath: /data/aperag
96117
replicaCount: 1

0 commit comments

Comments
 (0)