diff --git a/charts/graphscope-store/templates/configmap.yaml b/charts/graphscope-store/templates/configmap.yaml index 7fdc708474da..b504850f8f7f 100644 --- a/charts/graphscope-store/templates/configmap.yaml +++ b/charts/graphscope-store/templates/configmap.yaml @@ -116,6 +116,7 @@ data: sudo chown -R graphscope:graphscope {{ .Values.storeDataPath }} || true sudo chown -R graphscope:graphscope /etc/groot || true + sudo chown -R graphscope:graphscope /var/log/graphscope || true [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 ordinal=${BASH_REMATCH[1]} diff --git a/charts/graphscope-store/templates/coordinator/statefulset.yaml b/charts/graphscope-store/templates/coordinator/statefulset.yaml index ec9d18396486..1febcdfaaec0 100644 --- a/charts/graphscope-store/templates/coordinator/statefulset.yaml +++ b/charts/graphscope-store/templates/coordinator/statefulset.yaml @@ -135,20 +135,31 @@ spec: - name: config mountPath: /etc/groot/setup.sh subPath: setup.sh + - name: log + mountPath: {{ .Values.logPersistence.mountPath }} volumes: - name: config configMap: name: {{ include "graphscope-store.configmapName" . }} defaultMode: 0755 - {{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }} + {{- if and .Values.coordinator.persistence.enabled .Values.coordinator.persistence.existingClaim }} - name: meta persistentVolumeClaim: claimName: {{ printf "%s" (tpl .Values.coordinator.persistence.existingClaim .) }} - {{- else if not .Values.coordinator.persistence.enabled }} + {{- else if not .Values.coordinator.persistence.enabled }} - name: meta emptyDir: {} - {{- else if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }} + {{- end }} + {{- if not .Values.logPersistence.enabled }} + - name: log + emptyDir: {} + {{- else if .Values.logPersistence.existingClaim }} + - name: log + persistentVolumeClaim: + claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} + {{- end }} volumeClaimTemplates: + {{- if and .Values.coordinator.persistence.enabled (not .Values.coordinator.persistence.existingClaim) }} - metadata: name: meta {{- if .Values.persistence.annotations }} @@ -169,5 +180,27 @@ spec: {{- if .Values.coordinator.persistence.selector }} selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.coordinator.persistence.selector "context" $) | nindent 10 }} {{- end -}} - {{- end }} -{{- end -}} + {{- end }} + {{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} + - metadata: + name: log + {{- if .Values.persistence.annotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} + {{- end }} + {{- if .Values.persistence.labels }} + labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.logPersistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.logPersistence.size | quote }} + {{ include "graphscope-store.storageClass" . | nindent 8 }} + {{- if .Values.logPersistence.selector }} + selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} + {{- end -}} + {{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/graphscope-store/templates/frontend/statefulset.yaml b/charts/graphscope-store/templates/frontend/statefulset.yaml index 1cba12b122d3..ca3dc7d4500e 100644 --- a/charts/graphscope-store/templates/frontend/statefulset.yaml +++ b/charts/graphscope-store/templates/frontend/statefulset.yaml @@ -137,9 +137,42 @@ spec: - name: config mountPath: /etc/groot/setup.sh subPath: setup.sh + - name: log + mountPath: {{ .Values.logPersistence.mountPath }} volumes: - name: config configMap: name: {{ include "graphscope-store.configmapName" . }} defaultMode: 0755 + {{- if not .Values.logPersistence.enabled }} + - name: log + emptyDir: {} + {{- else if .Values.logPersistence.existingClaim }} + - name: log + persistentVolumeClaim: + claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} + {{- end }} + volumeClaimTemplates: + {{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} + - metadata: + name: log + {{- if .Values.persistence.annotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} + {{- end }} + {{- if .Values.persistence.labels }} + labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.logPersistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.logPersistence.size | quote }} + {{ include "graphscope-store.storageClass" . | nindent 8 }} + {{- if .Values.logPersistence.selector }} + selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} + {{- end -}} + {{- end }} {{- end }} diff --git a/charts/graphscope-store/templates/onepod/statefulset.yaml b/charts/graphscope-store/templates/onepod/statefulset.yaml index ae27127d0b86..c6896bb0a21f 100644 --- a/charts/graphscope-store/templates/onepod/statefulset.yaml +++ b/charts/graphscope-store/templates/onepod/statefulset.yaml @@ -137,6 +137,8 @@ spec: - name: config mountPath: /etc/groot/setup.sh subPath: setup.sh + - name: log + mountPath: {{ .Values.logPersistence.mountPath }} {{- if .Values.store.extraVolumeMounts }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }} {{- end }} @@ -148,15 +150,24 @@ spec: {{- if .Values.store.extraVolumes }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }} {{- end }} - {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} + {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} - name: data persistentVolumeClaim: claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }} - {{- else if not .Values.store.persistence.enabled }} + {{- else if not .Values.store.persistence.enabled }} - name: data emptyDir: {} - {{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} + {{- end }} + {{- if not .Values.logPersistence.enabled }} + - name: log + emptyDir: {} + {{- else if .Values.logPersistence.existingClaim }} + - name: log + persistentVolumeClaim: + claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} + {{- end }} volumeClaimTemplates: + {{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} - metadata: name: data {{- if .Values.persistence.annotations }} @@ -177,5 +188,27 @@ spec: {{- if .Values.store.persistence.selector }} selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }} {{- end -}} - {{- end }} + {{- end }} + {{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} + - metadata: + name: log + {{- if .Values.persistence.annotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} + {{- end }} + {{- if .Values.persistence.labels }} + labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.logPersistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.logPersistence.size | quote }} + {{ include "graphscope-store.storageClass" . | nindent 8 }} + {{- if .Values.logPersistence.selector }} + selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} + {{- end -}} + {{- end }} {{- end }} diff --git a/charts/graphscope-store/templates/store/statefulset-backup.yaml b/charts/graphscope-store/templates/store/statefulset-backup.yaml index 73483e840af8..5e545d605aa6 100644 --- a/charts/graphscope-store/templates/store/statefulset-backup.yaml +++ b/charts/graphscope-store/templates/store/statefulset-backup.yaml @@ -143,6 +143,8 @@ spec: - name: config mountPath: /etc/groot/setup.sh subPath: setup.sh + - name: log + mountPath: {{ .Values.logPersistence.mountPath }} {{- if .Values.store.extraVolumeMounts }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }} {{- end }} @@ -154,15 +156,24 @@ spec: {{- if .Values.store.extraVolumes }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }} {{- end }} - {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} + {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} - name: data persistentVolumeClaim: claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }} - {{- else if not .Values.store.persistence.enabled }} + {{- else if not .Values.store.persistence.enabled }} - name: data emptyDir: {} - {{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} + {{- end }} + {{- if not .Values.logPersistence.enabled }} + - name: log + emptyDir: {} + {{- else if .Values.logPersistence.existingClaim }} + - name: log + persistentVolumeClaim: + claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} + {{- end }} volumeClaimTemplates: + {{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} - metadata: name: data {{- if .Values.persistence.annotations }} @@ -183,6 +194,28 @@ spec: {{- if .Values.store.persistence.selector }} selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }} {{- end -}} - {{- end }} + {{- end }} + {{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} + - metadata: + name: log + {{- if .Values.persistence.annotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} + {{- end }} + {{- if .Values.persistence.labels }} + labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.logPersistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.logPersistence.size | quote }} + {{ include "graphscope-store.storageClass" . | nindent 8 }} + {{- if .Values.logPersistence.selector }} + selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} + {{- end -}} + {{- end }} {{- end -}} {{- end -}} diff --git a/charts/graphscope-store/templates/store/statefulset.yaml b/charts/graphscope-store/templates/store/statefulset.yaml index 9ebc14b71d3a..a794b3306ff0 100644 --- a/charts/graphscope-store/templates/store/statefulset.yaml +++ b/charts/graphscope-store/templates/store/statefulset.yaml @@ -139,6 +139,8 @@ spec: - name: config mountPath: /etc/groot/setup.sh subPath: setup.sh + - name: log + mountPath: {{ .Values.logPersistence.mountPath }} {{- if .Values.store.extraVolumeMounts }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumeMounts "context" $) | nindent 12 }} {{- end }} @@ -150,15 +152,24 @@ spec: {{- if .Values.store.extraVolumes }} {{- include "common.tplvalues.render" (dict "value" .Values.store.extraVolumes "context" $) | nindent 8 }} {{- end }} - {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} + {{- if and .Values.store.persistence.enabled .Values.store.persistence.existingClaim }} - name: data persistentVolumeClaim: claimName: {{ printf "%s" (tpl .Values.store.persistence.existingClaim .) }} - {{- else if not .Values.store.persistence.enabled }} + {{- else if not .Values.store.persistence.enabled }} - name: data emptyDir: {} - {{- else if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} + {{- end }} + {{- if not .Values.logPersistence.enabled }} + - name: log + emptyDir: {} + {{- else if .Values.logPersistence.existingClaim }} + - name: log + persistentVolumeClaim: + claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} + {{- end }} volumeClaimTemplates: + {{- if and .Values.store.persistence.enabled (not .Values.store.persistence.existingClaim) }} - metadata: name: data {{- if .Values.persistence.annotations }} @@ -179,5 +190,27 @@ spec: {{- if .Values.store.persistence.selector }} selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.store.persistence.selector "context" $) | nindent 10 }} {{- end -}} - {{- end }} + {{- end }} + {{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} + - metadata: + name: log + {{- if .Values.persistence.annotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }} + {{- end }} + {{- if .Values.persistence.labels }} + labels: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.labels "context" $) | nindent 10 }} + {{- end }} + spec: + accessModes: + {{- range .Values.logPersistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.logPersistence.size | quote }} + {{ include "graphscope-store.storageClass" . | nindent 8 }} + {{- if .Values.logPersistence.selector }} + selector: {{- include "graphscope-store.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} + {{- end -}} + {{- end }} {{- end -}} diff --git a/charts/graphscope-store/values.yaml b/charts/graphscope-store/values.yaml index 045b358c2380..915f2f66d53d 100644 --- a/charts/graphscope-store/values.yaml +++ b/charts/graphscope-store/values.yaml @@ -595,6 +595,27 @@ queryExecutionTimeoutMs: 600000 graphPlannerJoinMinPatternSize: 5 graphPlannerCboGlogueSize: 3 +## Log Persistence parameters +## +logPersistence: + ## Enable persistence using Persistent Volume Claims. If false, use emptyDir + enabled: false + ## Existing PVC to hold the log data. If not provided, a new PVC will be created. + existingClaim: "" + ## Persistent Volume storage class + storageClass: "" + ## Persistent Volume access modes + accessModes: + - ReadWriteOnce + ## Persistent Volume size + size: 1Gi + ## Persistent Volume annotations + annotations: {} + ## Persistent Volume labels + selector: {} + ## mountPath for the Persistent Volume + mountPath: "/var/log/graphscope" + ## Key-value pair separated by ; ## For example extraConfig="k1=v1;k2=v2" extraConfig: ""