Skip to content

Commit ef7bb3b

Browse files
Add volume for persistent heap dumps to participant charts (#3481)
This matches the mediator and sequencer where we already have it. I didn't go through extraVolumes since that only does the mounting and not creating the pvc and having pvc not do everything like it does for sequencer + mediator seemed more confusing than helpful. [static] Tested on scratch that I can deploy with and without this and if I produce an OOM the dump persists. Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
1 parent 8158bec commit ef7bb3b

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

cluster/helm/splice-participant/templates/participant.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ spec:
124124
{{- with .Values.resources }}
125125
resources: {{- toYaml . | nindent 10 }}
126126
{{- end }}
127-
{{- if and .Values.extraVolumeMounts (gt (len .Values.extraVolumeMounts) 0) }}
127+
{{- if or (and .Values.extraVolumeMounts (gt (len .Values.extraVolumeMounts) 0)) .Values.pvc }}
128128
volumeMounts:
129129
{{- range .Values.extraVolumeMounts }}
130130
- name: {{ .name }}
@@ -136,6 +136,10 @@ spec:
136136
readOnly: {{ .readOnly }}
137137
{{- end }}
138138
{{- end }}
139+
{{- if .Values.pvc }}
140+
- name: participant-volume
141+
mountPath: /persistent-data
142+
{{- end }}
139143
{{- end }}
140144
{{- if or (.Values.persistence.enablePgInitContainer) (.Values.extraInitContainers) }}
141145
initContainers:
@@ -178,7 +182,7 @@ spec:
178182
tolerations:
179183
{{- toYaml . | nindent 8 }}
180184
{{- end }}
181-
{{- if and .Values.extraVolumes (gt (len .Values.extraVolumes) 0) }}
185+
{{- if or (and .Values.extraVolumes (gt (len .Values.extraVolumes) 0)) .Values.pvc }}
182186
volumes:
183187
{{- range .Values.extraVolumes }}
184188
- name: {{ .name }}
@@ -191,8 +195,32 @@ spec:
191195
claimName: {{ .persistentVolumeClaim.claimName }}
192196
{{- end }}
193197
{{- end }}
198+
{{- if .Values.pvc }}
199+
- name: participant-volume
200+
persistentVolumeClaim:
201+
claimName: {{ .Release.Name }}-participant-pvc
202+
{{- end }}
194203
{{- end }}
195204
---
205+
{{- if .Values.pvc }}
206+
apiVersion: v1
207+
kind: PersistentVolumeClaim
208+
metadata:
209+
name: {{ .Release.Name }}-participant-pvc
210+
namespace: {{ .Release.Namespace }}
211+
labels:
212+
{{- include "splice-util-lib.default-labels" (set . "app" $.Release.Name) | nindent 4 }}
213+
annotations:
214+
helm.sh/resource-policy: keep
215+
spec:
216+
accessModes:
217+
- ReadWriteOnce
218+
resources:
219+
requests:
220+
storage: {{ .Values.pvc.size }}
221+
storageClassName: {{ .Values.pvc.volumeStorageClass }}
222+
{{- end }}
223+
---
196224
apiVersion: v1
197225
kind: Service
198226
metadata:

cluster/pulumi/sv-canton/src/participant.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
installSpliceHelmChart,
1414
loadYamlFromFile,
1515
SPLICE_ROOT,
16+
spliceConfig,
1617
SpliceCustomResourceOptions,
1718
} from '@lfdecentralizedtrust/splice-pulumi-common';
1819
import { SingleSvConfiguration } from '@lfdecentralizedtrust/splice-pulumi-common-sv';
@@ -86,6 +87,12 @@ export function installSvParticipant(
8687
enablePostgresMetrics: true,
8788
serviceAccountName: imagePullServiceAccountName,
8889
resources: svConfig.participant?.resources,
90+
pvc: spliceConfig.configuration.persistentHeapDumps
91+
? {
92+
size: '10Gi',
93+
volumeStorageClass: 'standard-rwo',
94+
}
95+
: undefined,
8996
},
9097
version,
9198
{

0 commit comments

Comments
 (0)