thanos-sidecar

by ScriptonBasestar

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:

  1. Uploads Prometheus TSDB blocks to object storage for long-term retention
  2. Exposes Store API for Thanos Query to access recent metrics
  3. 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

ParameterDescriptionDefault
prometheus.urlPrometheus URLhttp://prometheus:9090
thanos.tsdb.pathTSDB data path/prometheus
objstore.enabledEnable object storagetrue
objstore.typeStorage types3
prometheusDataVolume.existingClaimPrometheus PVC name""
service.grpcPortgRPC port10901
service.httpPortHTTP port10902

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartthanos-sidecar is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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