[bitnami/thanos] feat: Option to enable ephemeral persistent volume for compactor (#22808)

Signed-off-by: Martin Balint <martin.balint@threatmark.com>
Co-authored-by: Martin Balint <martin.balint@threatmark.com>
This commit is contained in:
Martin Bálint
2024-01-29 11:32:02 +01:00
committed by GitHub
parent df7972b4b7
commit 055c8ede10
5 changed files with 28 additions and 2 deletions

View File

@@ -35,4 +35,4 @@ maintainers:
name: thanos
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/thanos
version: 12.22.1
version: 12.23.0

View File

@@ -653,6 +653,7 @@ Check the section [Integrate Thanos with Prometheus and Alertmanager](#integrate
| `compactor.ingress.path` | Ingress path | `/` |
| `compactor.ingress.pathType` | Ingress path type | `ImplementationSpecific` |
| `compactor.persistence.enabled` | Enable data persistence using PVC(s) on Thanos Compactor pods | `true` |
| `compactor.persistence.ephemeral` | Use ephemeral volume for data persistence using PVC(s) on Thanos Compactor pods | `false` |
| `compactor.persistence.defaultEmptyDir` | Defaults to emptyDir if persistence is disabled. | `true` |
| `compactor.persistence.storageClass` | Specify the `storageClass` used to provision the volume | `""` |
| `compactor.persistence.accessModes` | PVC Access Modes for data volume | `["ReadWriteOnce"]` |

View File

@@ -223,8 +223,30 @@ spec:
{{- if or .Values.compactor.persistence.enabled .Values.compactor.persistence.defaultEmptyDir }}
- name: data
{{- if .Values.compactor.persistence.enabled }}
{{- if .Values.compactor.persistence.ephemeral }}
ephemeral:
volumeClaimTemplate:
metadata:
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.compactor.persistence.labels .Values.commonLabels ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: compactor
{{- if or .Values.compactor.persistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.compactor.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 14 }}
{{- end }}
spec:
accessModes:
{{- range .Values.compactor.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
{{- include "common.storage.class" (dict "persistence" .Values.compactor.persistence "global" .Values.global) | nindent 12 }}
resources:
requests:
storage: {{ .Values.compactor.persistence.size | quote }}
{{- else }}
persistentVolumeClaim:
claimName: {{ include "thanos.compactor.pvcName" . }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}

View File

@@ -3,7 +3,7 @@ Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.compactor.persistence.enabled (not .Values.compactor.persistence.existingClaim) .Values.compactor.enabled }}
{{- if and .Values.compactor.persistence.enabled (not (or .Values.compactor.persistence.existingClaim .Values.compactor.persistence.ephemeral)) .Values.compactor.enabled }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:

View File

@@ -2222,6 +2222,9 @@ compactor:
## @param compactor.persistence.enabled Enable data persistence using PVC(s) on Thanos Compactor pods
##
enabled: true
## @param compactor.persistence.ephemeral Use ephemeral volume for data persistence using PVC(s) on Thanos Compactor pods
##
ephemeral: false
## @param compactor.persistence.defaultEmptyDir Defaults to emptyDir if persistence is disabled.
##
defaultEmptyDir: true