Skip to content

Commit 59221a9

Browse files
committed
feat(chart/opensearch): add support for persistentVolumeClaimRetentionPolicy
Signed-off-by: Stefan Schwarz <stefan.schwarz@thomann.io>
1 parent 72d1e74 commit 59221a9

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

charts/opensearch/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
---
99
## [Unreleased]
1010
### Added
11+
- Support to set `persistentVolumeClaimRetentionPolicy`
1112
### Changed
1213
### Deprecated
1314
### Removed

charts/opensearch/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.3.2
18+
version: 3.3.3
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "3.3.2"
24+
appVersion: "3.3.3"
2525

2626
maintainers:
2727
- name: DandyDeveloper

charts/opensearch/templates/statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ spec:
5555
storageClassName: "{{ .Values.persistence.storageClass }}"
5656
{{- end }}
5757
{{- end }}
58+
{{- if (semverCompare ">= 1.32-0" .Capabilities.KubeVersion.Version) }}
59+
persistentVolumeClaimRetentionPolicy:
60+
whenDeleted: {{ .Values.persistence.persistentVolumeClaimRetentionPolicy.whenDeleted }}
61+
whenScaled: {{ .Values.persistence.persistentVolumeClaimRetentionPolicy.whenScaled }}
62+
{{- end }}
5863
{{- end }}
5964
template:
6065
metadata:

charts/opensearch/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ persistence:
220220
size: 8Gi
221221
annotations: {}
222222

223+
# This allows to automatically delete PVCs on StatefulSet deletion like described in
224+
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
225+
persistentVolumeClaimRetentionPolicy:
226+
whenDeleted: Retain
227+
whenScaled: Retain
228+
223229
extraVolumes: []
224230
# - name: extras
225231
# emptyDir: {}
@@ -285,7 +291,6 @@ metricsPort: 9600
285291
httpHostPort: ""
286292
transportHostPort: ""
287293

288-
289294
service:
290295
labels: {}
291296
labelsHeadless: {}

0 commit comments

Comments
 (0)