thanos-receive

by ScriptonBasestar

Helm chartv0.3.0App 0.37.2

Thanos Receive - accepts remote write from Prometheus for multi-tenant ingestion

About this chart

Thanos Receive Helm Chart

This chart deploys Thanos Receive on Kubernetes.

Thanos Receive accepts Prometheus remote write requests and stores data in object storage. It supports multi-tenancy and horizontal scaling via hashring.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2+
  • Object storage (S3, GCS, Azure Blob, etc.)

Installation

helm repo add scripton-charts https://scriptonbasestar-container.github.io/sb-helm-charts
helm install thanos-receive scripton-charts/thanos-receive

Configuration

Object Storage

Configure object storage in values.yaml:

objstore:
  type: "s3"
  s3:
    endpoint: "minio.minio.svc.cluster.local:9000"
    bucket: "thanos"
    accessKey: "minio"
    secretKey: "minio123"
    insecure: true

Or use an existing secret:

objstore:
  existingSecret: "thanos-objstore-secret"

Multi-Tenancy

Enable multi-tenancy:

thanos:
  tenancy:
    enabled: true
    header: "THANOS-TENANT"
    defaultTenant: "default-tenant"

Hashring Configuration

The chart automatically generates hashring configuration based on replicaCount. Adjust replication factor:

replicaCount: 3

thanos:
  receive:
    replicationFactor: 2
    tsdbRetention: "2h"

Prometheus Remote Write

Configure Prometheus to send metrics:

prometheus:
  remoteWrite:
    - url: http://thanos-receive.monitoring.svc.cluster.local:10908/api/v1/receive

For multi-tenant setups:

prometheus:
  remoteWrite:
    - url: http://thanos-receive.monitoring.svc.cluster.local:10908/api/v1/receive
      headers:
        THANOS-TENANT: my-tenant-id

Ports

PortProtocolDescription
10901gRPCStore API for Thanos Query
10902HTTPMetrics and status endpoints
10908HTTPRemote write receiver

Integration with Thanos Query

Add Receive to Thanos Query stores:

thanos:
  stores:
    - dnssrv+_grpc._tcp.thanos-receive-headless.monitoring.svc.cluster.local

Parameters

Common Parameters

ParameterDescriptionDefault
replicaCountNumber of Receive replicas3
image.repositoryImage repositoryquay.io/thanos/thanos
image.tagImage tag"" (uses appVersion)

Thanos Parameters

ParameterDescriptionDefault
thanos.receive.replicationFactorReplication factor1
thanos.receive.tsdbRetentionTSDB retention before upload"2h"
thanos.tenancy.enabledEnable multi-tenancyfalse
thanos.tenancy.headerTenant header name"THANOS-TENANT"
thanos.labelsLabels to add to metrics{}

Service Parameters

ParameterDescriptionDefault
service.typeService typeClusterIP
service.httpPortHTTP port10909
service.grpcPortgRPC port10907
service.remoteWritePortRemote write port10908

Persistence Parameters

ParameterDescriptionDefault
persistence.enabledEnable persistencetrue
persistence.sizePVC size50Gi
persistence.storageClassStorage class""

License

BSD-3-Clause

Deploy thanos-receive with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has thanos-receive 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-receive 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