[helm] Add a flag to enable/disable persistentVolumeClaimRetentionPolicy feature (#7640)

**What this PR does / why we need it**:

add a flag to enable/disable persistentVolumeClaimRetentionPolicy
feature which is available since kubernetes 1.23 but in alpha
(StatefulSetAutoDeletePVC) and disabled by default on most cloud
provider

I've set the flag to true by default, to not change the actual behavior
 
**Which issue(s) this PR fixes**:
Fixes #7249
pull/8089/head
Guillaume Durand 2 years ago committed by GitHub
parent 785fc2a62c
commit 55733561f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      docs/sources/installation/helm/reference.md
  2. 2
      production/helm/loki/templates/read/statefulset-read.yaml
  3. 2
      production/helm/loki/values.yaml

@ -2484,6 +2484,15 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>read.persistence.enableStatefulSetAutoDeletePVC</td>
<td>bool</td>
<td>Enable StatefulSetAutoDeletePVC feature</td>
<td><pre lang="json">
true
</pre>
</td>
</tr>
<tr>

@ -16,7 +16,7 @@ spec:
partition: 0
serviceName: {{ printf "%s-headless" (include "loki.readFullname" .) }}
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.read.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.

@ -852,6 +852,8 @@ read:
# -- Tolerations for read pods
tolerations: []
persistence:
# -- Enable StatefulSetAutoDeletePVC feature
enableStatefulSetAutoDeletePVC: true
# -- Size of persistent disk
size: 10Gi
# -- Storage class to be used.

Loading…
Cancel
Save