From bb9afbbe124ecdbe3ba772a137cfeb833e063b50 Mon Sep 17 00:00:00 2001 From: Michael Pohl Date: Mon, 11 Nov 2024 11:56:17 +0100 Subject: [PATCH] add persistentVolumeClaimRetentionPolicy for tempo ingester --- .../templates/ingester/statefulset-ingester.yaml | 9 +++++++++ charts/tempo-distributed/values.yaml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml b/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml index f7254deb89..a8c1c82225 100644 --- a/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml +++ b/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml @@ -28,6 +28,15 @@ spec: {{- include "ingester.selectorLabels" $dict | nindent 6}} serviceName: ingester podManagementPolicy: Parallel + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} + {{/* + Data on the read nodes is easy to replace, so we want to always delete PVCs to make + operation easier, and will rely on re-fetching data when needed. + */}} + persistentVolumeClaimRetentionPolicy: + whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} + whenScaled: {{ .Values.ingester.persistence.whenScaled }} + {{- end }} updateStrategy: {{- if .Values.ingester.zoneAwareReplication.enabled }} type: OnDelete diff --git a/charts/tempo-distributed/values.yaml b/charts/tempo-distributed/values.yaml index 6d1e894649..4f2c3dc268 100755 --- a/charts/tempo-distributed/values.yaml +++ b/charts/tempo-distributed/values.yaml @@ -211,6 +211,10 @@ ingester: storageClass: null # -- Annotations for ingester's persist volume claim annotations: {} + # -- Enable StatefulSetAutoDeletePVC feature + enableStatefulSetAutoDeletePVC: false + whenDeleted: Retain + whenScaled: Retain config: # -- Number of copies of spans to store in the ingester ring replication_factor: 3