Skip to content

Commit 25fa9e9

Browse files
authored
fix(interactive): Add PVC support for Insight logs (#4308)
This pull request introduces PVCs for the coordinator, frontend, and stores components within Insight. For instance, we can get log PVCs as follows: ![image](https://github.com/user-attachments/assets/fcb63fcf-47ce-424a-a955-c168fa0d2c37) Fixes #4307
1 parent d22802b commit 25fa9e9

File tree

7 files changed

+204
-17
lines changed

7 files changed

+204
-17
lines changed

charts/graphscope-store/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ data:
116116
117117
sudo chown -R graphscope:graphscope {{ .Values.storeDataPath }} || true
118118
sudo chown -R graphscope:graphscope /etc/groot || true
119+
sudo chown -R graphscope:graphscope /var/log/graphscope || true
119120
120121
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
121122
ordinal=${BASH_REMATCH[1]}

charts/graphscope-store/templates/coordinator/statefulset.yaml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,31 @@ spec:
135135
- name: config
136136
mountPath: /etc/groot/setup.sh
137137
subPath: setup.sh
138+
- name: log
139+
mountPath: {{ .Values.logPersistence.mountPath }}
138140
volumes:
139141
- name: config
140142
configMap:
141143
name: {{ include "graphscope-store.configmapName" . }}
142144
defaultMode: 0755
143-
{{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }}
145+
{{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }}
144146
- name: meta
145147
persistentVolumeClaim:
146148
claimName: {{ printf "%s" (tpl .Values.coordinator.persistence.existingClaim .) }}
147-
{{- else if not .Values.coordinator.persistence.enabled }}
149+
{{- else if not .Values.coordinator.persistence.enabled }}
148150
- name: meta
149151
emptyDir: {}
150-
{{- else if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }}
152+
{{- end }}
153+
{{- if not .Values.logPersistence.enabled }}
154+
- name: log
155+
emptyDir: {}
156+
{{- else if .Values.logPersistence.existingClaim }}
157+
- name: log
158+
persistentVolumeClaim:
159+
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
160+
{{- end }}
151161
volumeClaimTemplates:
162+
{{- if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }}
152163
- metadata:
153164
name: meta
154165
{{- if .Values.persistence.annotations }}
@@ -169,5 +180,27 @@ spec:
169180
{{- if .Values.coordinator.persistence.selector }}
170181
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.coordinator.persistence.selector "context" $) | nindent 10 }}
171182
{{- end -}}
172-
{{- end }}
173-
{{- end -}}
183+
{{- end }}
184+
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
185+
- metadata:
186+
name: log
187+
{{- if .Values.persistence.annotations }}
188+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
189+
{{- end }}
190+
{{- if .Values.persistence.labels }}
191+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
192+
{{- end }}
193+
spec:
194+
accessModes:
195+
{{- range .Values.logPersistence.accessModes }}
196+
- {{ . | quote }}
197+
{{- end }}
198+
resources:
199+
requests:
200+
storage: {{ .Values.logPersistence.size | quote }}
201+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
202+
{{- if .Values.logPersistence.selector }}
203+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
204+
{{- end -}}
205+
{{- end }}
206+
{{- end -}}

charts/graphscope-store/templates/frontend/statefulset.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,42 @@ spec:
137137
- name: config
138138
mountPath: /etc/groot/setup.sh
139139
subPath: setup.sh
140+
- name: log
141+
mountPath: {{ .Values.logPersistence.mountPath }}
140142
volumes:
141143
- name: config
142144
configMap:
143145
name: {{ include "graphscope-store.configmapName" . }}
144146
defaultMode: 0755
147+
{{- if not .Values.logPersistence.enabled }}
148+
- name: log
149+
emptyDir: {}
150+
{{- else if .Values.logPersistence.existingClaim }}
151+
- name: log
152+
persistentVolumeClaim:
153+
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
154+
{{- end }}
155+
volumeClaimTemplates:
156+
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
157+
- metadata:
158+
name: log
159+
{{- if .Values.persistence.annotations }}
160+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
161+
{{- end }}
162+
{{- if .Values.persistence.labels }}
163+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
164+
{{- end }}
165+
spec:
166+
accessModes:
167+
{{- range .Values.logPersistence.accessModes }}
168+
- {{ . | quote }}
169+
{{- end }}
170+
resources:
171+
requests:
172+
storage: {{ .Values.logPersistence.size | quote }}
173+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
174+
{{- if .Values.logPersistence.selector }}
175+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
176+
{{- end -}}
177+
{{- end }}
145178
{{- end }}

charts/graphscope-store/templates/onepod/statefulset.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ spec:
137137
- name: config
138138
mountPath: /etc/groot/setup.sh
139139
subPath: setup.sh
140+
- name: log
141+
mountPath: {{ .Values.logPersistence.mountPath }}
140142
{{- if .Values.store.extraVolumeMounts }}
141143
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
142144
{{- end }}
@@ -148,15 +150,24 @@ spec:
148150
{{- if .Values.store.extraVolumes }}
149151
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
150152
{{- end }}
151-
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
153+
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
152154
- name: data
153155
persistentVolumeClaim:
154156
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
155-
{{- else if not .Values.store.persistence.enabled }}
157+
{{- else if not .Values.store.persistence.enabled }}
156158
- name: data
157159
emptyDir: {}
158-
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
160+
{{- end }}
161+
{{- if not .Values.logPersistence.enabled }}
162+
- name: log
163+
emptyDir: {}
164+
{{- else if .Values.logPersistence.existingClaim }}
165+
- name: log
166+
persistentVolumeClaim:
167+
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
168+
{{- end }}
159169
volumeClaimTemplates:
170+
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
160171
- metadata:
161172
name: data
162173
{{- if .Values.persistence.annotations }}
@@ -177,5 +188,27 @@ spec:
177188
{{- if .Values.store.persistence.selector }}
178189
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
179190
{{- end -}}
180-
{{- end }}
191+
{{- end }}
192+
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
193+
- metadata:
194+
name: log
195+
{{- if .Values.persistence.annotations }}
196+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
197+
{{- end }}
198+
{{- if .Values.persistence.labels }}
199+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
200+
{{- end }}
201+
spec:
202+
accessModes:
203+
{{- range .Values.logPersistence.accessModes }}
204+
- {{ . | quote }}
205+
{{- end }}
206+
resources:
207+
requests:
208+
storage: {{ .Values.logPersistence.size | quote }}
209+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
210+
{{- if .Values.logPersistence.selector }}
211+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
212+
{{- end -}}
213+
{{- end }}
181214
{{- end }}

charts/graphscope-store/templates/store/statefulset-backup.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ spec:
143143
- name: config
144144
mountPath: /etc/groot/setup.sh
145145
subPath: setup.sh
146+
- name: log
147+
mountPath: {{ .Values.logPersistence.mountPath }}
146148
{{- if .Values.store.extraVolumeMounts }}
147149
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
148150
{{- end }}
@@ -154,15 +156,24 @@ spec:
154156
{{- if .Values.store.extraVolumes }}
155157
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
156158
{{- end }}
157-
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
159+
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
158160
- name: data
159161
persistentVolumeClaim:
160162
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
161-
{{- else if not .Values.store.persistence.enabled }}
163+
{{- else if not .Values.store.persistence.enabled }}
162164
- name: data
163165
emptyDir: {}
164-
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
166+
{{- end }}
167+
{{- if not .Values.logPersistence.enabled }}
168+
- name: log
169+
emptyDir: {}
170+
{{- else if .Values.logPersistence.existingClaim }}
171+
- name: log
172+
persistentVolumeClaim:
173+
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
174+
{{- end }}
165175
volumeClaimTemplates:
176+
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
166177
- metadata:
167178
name: data
168179
{{- if .Values.persistence.annotations }}
@@ -183,6 +194,28 @@ spec:
183194
{{- if .Values.store.persistence.selector }}
184195
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
185196
{{- end -}}
186-
{{- end }}
197+
{{- end }}
198+
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
199+
- metadata:
200+
name: log
201+
{{- if .Values.persistence.annotations }}
202+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
203+
{{- end }}
204+
{{- if .Values.persistence.labels }}
205+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
206+
{{- end }}
207+
spec:
208+
accessModes:
209+
{{- range .Values.logPersistence.accessModes }}
210+
- {{ . | quote }}
211+
{{- end }}
212+
resources:
213+
requests:
214+
storage: {{ .Values.logPersistence.size | quote }}
215+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
216+
{{- if .Values.logPersistence.selector }}
217+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
218+
{{- end -}}
219+
{{- end }}
187220
{{- end -}}
188221
{{- end -}}

charts/graphscope-store/templates/store/statefulset.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ spec:
139139
- name: config
140140
mountPath: /etc/groot/setup.sh
141141
subPath: setup.sh
142+
- name: log
143+
mountPath: {{ .Values.logPersistence.mountPath }}
142144
{{- if .Values.store.extraVolumeMounts }}
143145
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }}
144146
{{- end }}
@@ -150,15 +152,24 @@ spec:
150152
{{- if .Values.store.extraVolumes }}
151153
{{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }}
152154
{{- end }}
153-
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
155+
{{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }}
154156
- name: data
155157
persistentVolumeClaim:
156158
claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }}
157-
{{- else if not .Values.store.persistence.enabled }}
159+
{{- else if not .Values.store.persistence.enabled }}
158160
- name: data
159161
emptyDir: {}
160-
{{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
162+
{{- end }}
163+
{{- if not .Values.logPersistence.enabled }}
164+
- name: log
165+
emptyDir: {}
166+
{{- else if .Values.logPersistence.existingClaim }}
167+
- name: log
168+
persistentVolumeClaim:
169+
claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }}
170+
{{- end }}
161171
volumeClaimTemplates:
172+
{{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }}
162173
- metadata:
163174
name: data
164175
{{- if .Values.persistence.annotations }}
@@ -179,5 +190,27 @@ spec:
179190
{{- if .Values.store.persistence.selector }}
180191
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }}
181192
{{- end -}}
182-
{{- end }}
193+
{{- end }}
194+
{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }}
195+
- metadata:
196+
name: log
197+
{{- if .Values.persistence.annotations }}
198+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
199+
{{- end }}
200+
{{- if .Values.persistence.labels }}
201+
labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }}
202+
{{- end }}
203+
spec:
204+
accessModes:
205+
{{- range .Values.logPersistence.accessModes }}
206+
- {{ . | quote }}
207+
{{- end }}
208+
resources:
209+
requests:
210+
storage: {{ .Values.logPersistence.size | quote }}
211+
{{ include "graphscope-store.storageClass" . | nindent 8 }}
212+
{{- if .Values.logPersistence.selector }}
213+
selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }}
214+
{{- end -}}
215+
{{- end }}
183216
{{- end -}}

charts/graphscope-store/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,27 @@ queryExecutionTimeoutMs: 600000
595595
graphPlannerJoinMinPatternSize: 5
596596
graphPlannerCboGlogueSize: 3
597597

598+
## Log Persistence parameters
599+
##
600+
logPersistence:
601+
## Enable persistence using Persistent Volume Claims. If false, use emptyDir
602+
enabled: false
603+
## Existing PVC to hold the log data. If not provided, a new PVC will be created.
604+
existingClaim: ""
605+
## Persistent Volume storage class
606+
storageClass: ""
607+
## Persistent Volume access modes
608+
accessModes:
609+
- ReadWriteOnce
610+
## Persistent Volume size
611+
size: 1Gi
612+
## Persistent Volume annotations
613+
annotations: {}
614+
## Persistent Volume labels
615+
selector: {}
616+
## mountPath for the Persistent Volume
617+
mountPath: "/var/log/graphscope"
618+
598619
## Key-value pair separated by ;
599620
## For example extraConfig="k1=v1;k2=v2"
600621
extraConfig: ""

0 commit comments

Comments
 (0)