diff --git a/thanos/Chart.yaml b/thanos/Chart.yaml index 663d1b35..28690706 100644 --- a/thanos/Chart.yaml +++ b/thanos/Chart.yaml @@ -9,7 +9,7 @@ keywords: sources: - https://github.com/thanos-io/thanos - https://github.com/banzaicloud/banzai-charts/tree/master/thanos -version: 0.4.2 +version: 0.4.3 icon: https://raw.githubusercontent.com/thanos-io/thanos/master/docs/img/Thanos-logo_fullmedium.png maintainers: - name: Banzai Cloud diff --git a/thanos/README.md b/thanos/README.md index 76eb5b17..dbd1b8a9 100644 --- a/thanos/README.md +++ b/thanos/README.md @@ -305,6 +305,9 @@ timePartioning: | compact.compactConcurrency | Number of goroutines to use when compacting groups. | 1 | | compact.dataVolume.backend | Data volume for the compactor to store temporary data defaults to emptyDir. | {} | | compact.persistentVolumeClaim | Create the specified persistentVolumeClaim in case persistentVolumeClaim is used for the dataVolume.backend above and needs to be created. | {} | +| compact.relabel_configs | array of relabel-configs to be used in configuring sharding | [] | + + ## Bucket diff --git a/thanos/templates/compact-deployment.yaml b/thanos/templates/compact-deployment.yaml index ce86cbf5..4e3a5aec 100644 --- a/thanos/templates/compact-deployment.yaml +++ b/thanos/templates/compact-deployment.yaml @@ -61,6 +61,9 @@ spec: - "--retention.resolution-1h={{ .Values.compact.retentionResolution1h }}" - "--block-sync-concurrency={{ .Values.compact.blockSyncConcurrency }}" - "--compact.concurrency={{ .Values.compact.compactConcurrency }}" + {{- if .Values.compact.relabel_configs }} + - "--selector.relabel-config-file=/var/thanos/relabel-configs/relabel-configs.yaml" + {{- end }} - "--wait" {{ with .Values.compact.extraArgs }}{{ toYaml . | indent 8 }}{{- end }} ports: @@ -72,6 +75,10 @@ spec: readOnly: true - name: data-volume mountPath: /var/thanos/compact + {{- if .Values.compact.relabel_configs }} + - name: relabel-configs-volume + mountPath: /var/thanos/relabel-configs + {{ end }} resources: {{ toYaml .Values.compact.resources | nindent 10 }} volumes: - name: data-volume @@ -87,6 +94,11 @@ spec: {{- else }} secretName: {{ include "thanos.fullname" . }} {{- end }} + {{- if .Values.compact.relabel_configs }} + - name: relabel-configs-volume + configMap: + name: {{ include "thanos.componentname" (list $ "compact") }}-relabel-configs + {{- end }} {{- with .Values.compact.securityContext }} securityContext: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/thanos/templates/compact-relabel-configmap.yaml b/thanos/templates/compact-relabel-configmap.yaml new file mode 100644 index 00000000..05356266 --- /dev/null +++ b/thanos/templates/compact-relabel-configmap.yaml @@ -0,0 +1,16 @@ +{{ if .Values.compact.relabel_configs }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "thanos.componentname" (list $ "compact") }}-relabel-configs + labels: + app.kubernetes.io/name: {{ include "thanos.name" . }} + helm.sh/chart: {{ include "thanos.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} + app.kubernetes.io/component: compact +data: + relabel-configs.yaml: |- + {{- toYaml .Values.compact.relabel_configs | nindent 5}} +{{- end}} diff --git a/thanos/values.yaml b/thanos/values.yaml index 4367c93b..685e73b7 100644 --- a/thanos/values.yaml +++ b/thanos/values.yaml @@ -711,6 +711,15 @@ compact: # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity affinity: {} + #relabel-configs to use for sharding the compactor + #https://thanos.io/tip/components/compact.md/#flags + #https://thanos.io/tip/thanos/sharding.md/#relabelling + relabel_configs: [] + #- action: drop + # regex: "A" + # source_labels: + # - cluster + bucket: enabled: true # Number of replicas running from bucket component