diff --git a/bitnami/thanos/templates/receive/statefulset.yaml b/bitnami/thanos/templates/receive/statefulset.yaml index 848b050777c372..63e95d23c054d8 100644 --- a/bitnami/thanos/templates/receive/statefulset.yaml +++ b/bitnami/thanos/templates/receive/statefulset.yaml @@ -309,11 +309,13 @@ spec: - name: data emptyDir: {} {{- else if and .Values.receive.persistence.enabled (not .Values.receive.persistence.existingClaim) }} + {{- if semverCompare ">=1.23-0" (include "common.capabilities.kubeVersion" .) -}} {{- if .Values.receive.persistentVolumeClaimRetentionPolicy.enabled }} persistentVolumeClaimRetentionPolicy: whenDeleted: {{ .Values.receive.persistentVolumeClaimRetentionPolicy.whenDeleted }} whenScaled: {{ .Values.receive.persistentVolumeClaimRetentionPolicy.whenScaled }} {{- end }} + {{- end }} volumeClaimTemplates: - metadata: name: data diff --git a/bitnami/thanos/templates/ruler/statefulset.yaml b/bitnami/thanos/templates/ruler/statefulset.yaml index 696e28d9b186d9..347311bec18080 100644 --- a/bitnami/thanos/templates/ruler/statefulset.yaml +++ b/bitnami/thanos/templates/ruler/statefulset.yaml @@ -288,11 +288,13 @@ spec: - name: data emptyDir: {} {{- else if and .Values.ruler.persistence.enabled (not .Values.ruler.persistence.existingClaim) }} + {{- if semverCompare ">=1.23-0" (include "common.capabilities.kubeVersion" .) -}} {{- if .Values.ruler.persistentVolumeClaimRetentionPolicy.enabled }} persistentVolumeClaimRetentionPolicy: whenDeleted: {{ .Values.ruler.persistentVolumeClaimRetentionPolicy.whenDeleted }} whenScaled: {{ .Values.ruler.persistentVolumeClaimRetentionPolicy.whenScaled }} {{- end }} + {{- end }} volumeClaimTemplates: - metadata: name: data diff --git a/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml b/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml index b16e6fa220c1ed..8a5d201b3699ae 100644 --- a/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml +++ b/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml @@ -330,11 +330,13 @@ spec: - name: data emptyDir: {} {{- else if and $.Values.storegateway.persistence.enabled (not $.Values.storegateway.persistence.existingClaim) }} + {{- if semverCompare ">=1.23-0" (include "common.capabilities.kubeVersion" $) -}} {{- if $.Values.storegateway.persistentVolumeClaimRetentionPolicy.enabled }} persistentVolumeClaimRetentionPolicy: whenDeleted: {{ $.Values.storegateway.persistentVolumeClaimRetentionPolicy.whenDeleted }} whenScaled: {{ $.Values.storegateway.persistentVolumeClaimRetentionPolicy.whenScaled }} {{- end }} + {{- end }} volumeClaimTemplates: - metadata: name: data diff --git a/bitnami/thanos/templates/storegateway/statefulset.yaml b/bitnami/thanos/templates/storegateway/statefulset.yaml index 8175fad2393994..5333f2c34d96f5 100644 --- a/bitnami/thanos/templates/storegateway/statefulset.yaml +++ b/bitnami/thanos/templates/storegateway/statefulset.yaml @@ -285,11 +285,13 @@ spec: - name: data emptyDir: {} {{- else if and .Values.storegateway.persistence.enabled (not .Values.storegateway.persistence.existingClaim) }} + {{- if semverCompare ">=1.23-0" (include "common.capabilities.kubeVersion" .) -}} {{- if .Values.storegateway.persistentVolumeClaimRetentionPolicy.enabled }} persistentVolumeClaimRetentionPolicy: whenDeleted: {{ .Values.storegateway.persistentVolumeClaimRetentionPolicy.whenDeleted }} whenScaled: {{ .Values.storegateway.persistentVolumeClaimRetentionPolicy.whenScaled }} {{- end }} + {{- end }} volumeClaimTemplates: - metadata: name: data