thanos-sidecar
Helm chartv0.3.0App 0.37.2
Thanos Sidecar - Prometheus companion for block upload and Store API
About this chart
Thanos Sidecar Helm Chart
Thanos Sidecar runs alongside Prometheus to upload TSDB blocks to object storage and expose Store API for real-time metric queries.
Overview
The Sidecar component:
- Uploads Prometheus TSDB blocks to object storage for long-term retention
- Exposes Store API for Thanos Query to access recent metrics
- Optionally watches for config changes and triggers Prometheus reload
Deployment Modes
Standalone Deployment (This Chart)
Deploys Sidecar as a separate Deployment connecting to Prometheus via HTTP.
Sidecar Container Mode
Add Thanos Sidecar as a container in your Prometheus pod spec (recommended for production).
Prerequisites
- Kubernetes 1.19+
- Helm 3.2+
- Prometheus instance with accessible TSDB
- Object storage (optional, for block upload)
Installation
helm repo add scripton-charts https://scriptonbasestar-container.github.io/sb-helm-charts
helm install thanos-sidecar scripton-charts/thanos-sidecar \
--set prometheus.url=http://prometheus:9090 \
--set prometheusDataVolume.existingClaim=prometheus-data
Configuration
Prometheus Connection
prometheus:
url: "http://prometheus:9090"
readyTimeout: "10m"
thanos:
tsdb:
path: "/prometheus"
Object Storage (for block upload)
objstore:
enabled: true
type: "s3"
s3:
endpoint: "minio:9000"
bucket: "thanos"
accessKey: "admin"
secretKey: "password"
insecure: true
Config Reloader
thanos:
reloader:
enabled: true
configFile: "/etc/prometheus/prometheus.yml"
ruleDir: "/etc/prometheus/rules"
Parameters
| Parameter | Description | Default |
|---|---|---|
prometheus.url | Prometheus URL | http://prometheus:9090 |
thanos.tsdb.path | TSDB data path | /prometheus |
objstore.enabled | Enable object storage | true |
objstore.type | Storage type | s3 |
prometheusDataVolume.existingClaim | Prometheus PVC name | "" |
service.grpcPort | gRPC port | 10901 |
service.httpPort | HTTP port | 10902 |
Sidecar Container Example
For Prometheus Helm chart, add:
prometheus:
prometheusSpec:
containers:
- name: thanos-sidecar
image: quay.io/thanos/thanos:v0.37.2
args:
- sidecar
- --prometheus.url=http://localhost:9090
- --tsdb.path=/prometheus
- --objstore.config-file=/etc/thanos/objstore.yaml
ports:
- name: grpc
containerPort: 10901
- name: http
containerPort: 10902
volumeMounts:
- name: prometheus-db
mountPath: /prometheus
- name: thanos-objstore
mountPath: /etc/thanos
License
BSD-3-Clause
Deploy thanos-sidecar with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has thanos-sidecar on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartthanos-sidecar is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply