Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for sharding the compactor by relabel-configs #1232

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion thanos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions thanos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions thanos/templates/compact-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
16 changes: 16 additions & 0 deletions thanos/templates/compact-relabel-configmap.yaml
Original file line number Diff line number Diff line change
@@ -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}}
9 changes: 9 additions & 0 deletions thanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down