From c955b0e811cdaf59a836e20288f58cf99256db52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Marceau?= <108883925+clarifai-fmarceau@users.noreply.github.com> Date: Fri, 31 May 2024 02:10:24 -0400 Subject: [PATCH] [bitnami/thanos] Receive, ruler & storegateway statefulsets persistentVolumeClaimRetentionPolicy support (#25676) --- bitnami/thanos/CHANGELOG.md | 8 +++- bitnami/thanos/Chart.yaml | 2 +- bitnami/thanos/README.md | 9 +++++ .../thanos/templates/receive/statefulset.yaml | 7 ++++ .../thanos/templates/ruler/statefulset.yaml | 7 ++++ .../storegateway/statefulset-sharded.yaml | 7 ++++ .../templates/storegateway/statefulset.yaml | 7 ++++ bitnami/thanos/values.yaml | 39 +++++++++++++++++++ 8 files changed, 83 insertions(+), 3 deletions(-) diff --git a/bitnami/thanos/CHANGELOG.md b/bitnami/thanos/CHANGELOG.md index 79bd01c4e2e794..39654ff65641bd 100644 --- a/bitnami/thanos/CHANGELOG.md +++ b/bitnami/thanos/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog -## 15.5.1 (2024-05-28) +## 15.6.0 (2024-05-30) -* [bitnami/thanos] Release 15.5.1 ([#26517](https://github.com/bitnami/charts/pull/26517)) +* [bitnami/thanos] Receive, ruler & storegateway statefulsets persistentVolumeClaimRetentionPolicy support ([#25676](https://github.com/bitnami/charts/pull/25676)) + +## 15.5.1 (2024-05-28) + +* [bitnami/thanos] Release 15.5.1 (#26517) ([06b7586](https://github.com/bitnami/charts/commit/06b7586930c7cd1fefb0e1f4cdd88cd7e8c4655f)), closes [#26517](https://github.com/bitnami/charts/issues/26517) ## 15.5.0 (2024-05-21) diff --git a/bitnami/thanos/Chart.yaml b/bitnami/thanos/Chart.yaml index 5a4766fef863eb..75a62b678af32b 100644 --- a/bitnami/thanos/Chart.yaml +++ b/bitnami/thanos/Chart.yaml @@ -35,4 +35,4 @@ maintainers: name: thanos sources: - https://github.com/bitnami/charts/tree/main/bitnami/thanos -version: 15.5.1 +version: 15.6.0 diff --git a/bitnami/thanos/README.md b/bitnami/thanos/README.md index b9ca8e9db950de..76804251cea39c 100644 --- a/bitnami/thanos/README.md +++ b/bitnami/thanos/README.md @@ -1039,6 +1039,9 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `storegateway.persistence.labels` | Labels for the PVC | `{}` | | `storegateway.persistence.annotations` | Annotations for the PVC | `{}` | | `storegateway.persistence.existingClaim` | Name of an existing PVC to use | `""` | +| `storegateway.persistentVolumeClaimRetentionPolicy.enabled` | Enable Persistent volume retention policy for Thanos Store Gateway Statefulset | `false` | +| `storegateway.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` | +| `storegateway.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` | | `storegateway.automountServiceAccountToken` | Enable/disable auto mounting of the service account token only for the sts | `true` | | `storegateway.serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | | `storegateway.serviceAccount.name` | Name of the service account to use. If not set and create is true, a name is generated using the fullname template. | `""` | @@ -1201,6 +1204,9 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `ruler.persistence.size` | PVC Storage Request for data volume | `8Gi` | | `ruler.persistence.annotations` | Annotations for the PVC | `{}` | | `ruler.persistence.existingClaim` | Name of an existing PVC to use | `""` | +| `ruler.persistentVolumeClaimRetentionPolicy.enabled` | Enable Persistent volume retention policy for Thanos Ruler Statefulset | `false` | +| `ruler.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` | +| `ruler.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` | | `ruler.automountServiceAccountToken` | Enable/disable auto mounting of the service account token only for the sts | `true` | | `ruler.serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | | `ruler.serviceAccount.name` | Name of the service account to use. If not set and create is true, a name is generated using the fullname template. | `""` | @@ -1367,6 +1373,9 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `receive.persistence.labels` | Labels for the PVC | `{}` | | `receive.persistence.annotations` | Annotations for the PVC | `{}` | | `receive.persistence.existingClaim` | Name of an existing PVC to use | `""` | +| `receive.persistentVolumeClaimRetentionPolicy.enabled` | Enable Persistent volume retention policy for Thanos Receive Statefulset | `false` | +| `receive.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` | +| `receive.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` | | `receive.ingress.enabled` | Set to true to enable ingress record generation | `false` | | `receive.ingress.hostname` | When the ingress is enabled, a host pointing to this will be created | `thanos-receive.local` | | `receive.ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` | diff --git a/bitnami/thanos/templates/receive/statefulset.yaml b/bitnami/thanos/templates/receive/statefulset.yaml index ac2a1394b94fae..63e95d23c054d8 100644 --- a/bitnami/thanos/templates/receive/statefulset.yaml +++ b/bitnami/thanos/templates/receive/statefulset.yaml @@ -309,6 +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 03d39c310d2b5e..347311bec18080 100644 --- a/bitnami/thanos/templates/ruler/statefulset.yaml +++ b/bitnami/thanos/templates/ruler/statefulset.yaml @@ -288,6 +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 ee42401189a850..8a5d201b3699ae 100644 --- a/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml +++ b/bitnami/thanos/templates/storegateway/statefulset-sharded.yaml @@ -330,6 +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 05e9710ecf7747..5333f2c34d96f5 100644 --- a/bitnami/thanos/templates/storegateway/statefulset.yaml +++ b/bitnami/thanos/templates/storegateway/statefulset.yaml @@ -285,6 +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 diff --git a/bitnami/thanos/values.yaml b/bitnami/thanos/values.yaml index 11f2c9e01f203e..b66cab5d4b9db5 100644 --- a/bitnami/thanos/values.yaml +++ b/bitnami/thanos/values.yaml @@ -2972,6 +2972,19 @@ storegateway: ## If defined, PVC must be created manually before volume will be bound ## existingClaim: "" + ## Persistent Volume Claim Retention Policy + ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + ## + persistentVolumeClaimRetentionPolicy: + ## @param storegateway.persistentVolumeClaimRetentionPolicy.enabled Enable Persistent volume retention policy for Thanos Store Gateway Statefulset + ## + enabled: false + ## @param storegateway.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced + ## + whenScaled: Retain + ## @param storegateway.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted + ## + whenDeleted: Retain ## @param storegateway.automountServiceAccountToken Enable/disable auto mounting of the service account token only for the sts ## automountServiceAccountToken: true @@ -3699,6 +3712,19 @@ ruler: ## If defined, PVC must be created manually before volume will be bound ## existingClaim: "" + ## Persistent Volume Claim Retention Policy + ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + ## + persistentVolumeClaimRetentionPolicy: + ## @param ruler.persistentVolumeClaimRetentionPolicy.enabled Enable Persistent volume retention policy for Thanos Ruler Statefulset + ## + enabled: false + ## @param ruler.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced + ## + whenScaled: Retain + ## @param ruler.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted + ## + whenDeleted: Retain ## @param ruler.automountServiceAccountToken Enable/disable auto mounting of the service account token only for the sts ## automountServiceAccountToken: true @@ -4353,6 +4379,19 @@ receive: ## If defined, PVC must be created manually before volume will be bound ## existingClaim: "" + ## Persistent Volume Claim Retention Policy + ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + ## + persistentVolumeClaimRetentionPolicy: + ## @param receive.persistentVolumeClaimRetentionPolicy.enabled Enable Persistent volume retention policy for Thanos Receive Statefulset + ## + enabled: false + ## @param receive.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced + ## + whenScaled: Retain + ## @param receive.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted + ## + whenDeleted: Retain ## Configure the ingress resource that allows you to access Thanos Receive ## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/ ##