thanos

by joaquinito2051

Helm chartv3.4.0App 0.17.2

Thanos is a highly available metrics system that can be added on top of existing Prometheus deployments, providing a global query view across all Prometheus installations.

About this chart

Thanos

Thanos is a highly available metrics system that can be added on top of existing Prometheus deployments, providing a global query view across all Prometheus installations.

TL;DR

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-release bitnami/thanos

Introduction

This chart bootstraps a Thanos deployment on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.1.0
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-release bitnami/thanos

These commands deploy Thanos on the Kubernetes cluster with the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release chart:

helm uninstall my-release

Architecture

This charts allows you install several Thanos components, so you deploy an architecture as the one below:

                       ┌──────────────┐                  ┌──────────────┐      ┌──────────────┐
                       │ Thanos       │───────────┬────▶ │ Thanos Store │      │ Thanos       │
                       │ Query        │           │      │ Gateway      │      │ Compactor    │
                       └──────────────┘           │      └──────────────┘      └──────────────┘
                   push                           │             │                     │
┌──────────────┐   alerts   ┌──────────────┐      │             │ storages            │ Downsample &
│ Alertmanager │ ◀──────────│ Thanos       │ ◀────┤             │ query metrics       │ compact blocks
│ (*)          │            │ Ruler        │      │             │                     │
└──────────────┘            └──────────────┘      │             ▼                     │
      ▲                            │              │      ┌───────────────┐            │
      │ push alerts                └──────────────│────▶ │ MinIO(TM) (*) │ ◀──────────┘
      │                                           │      │               │
┌ ── ── ── ── ── ── ── ── ── ──┐                  │      └───────────────┘
│┌────────────┐  ┌────────────┐│                  │             ▲
││ Prometheus │─▶│ Thanos     ││ ◀────────────────┘             │
││ (*)        │◀─│ Sidecar (*)││    query                       │ inspect
│└────────────┘  └────────────┘│    metrics                     │ blocks
└ ── ── ── ── ── ── ── ── ── ──┘                                │
                                                         ┌──────────────┐
                                                         │ Thanos       │
                                                         │ Bucket Web   │
                                                         └──────────────┘

Note: Components marked with (*) are provided by subchart(s) (such as the Bitnami MinIOTM chart) or external charts (such as the Bitnami kube-prometheus chart).

Check the section Integrate Thanos with Prometheus and Alertmanager for detailed instructions to deploy this architecture.

Parameters

The following tables lists the configurable parameters of the Thanos chart and their default values per section/component:

Global parameters

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
global.storageClassGlobal storage class for dynamic provisioningnil

Common parameters

ParameterDescriptionDefault
image.registryThanos image registrydocker.io
image.repositoryThanos image namebitnami/thanos
image.tagThanos image tag{TAG_NAME}
image.pullPolicyThanos image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
nameOverrideString to partially override common.names.fullnamenil
fullnameOverrideString to fully override common.names.fullnamenil
clusterDomainDefault Kubernetes cluster domaincluster.local
objstoreConfigObjstore configurationnil
indexCacheConfigIndex cache configurationnil
bucketCacheConfigBucket cache configurationnil
existingObjstoreSecretName of existing secret with Objstore configurationnil
existingObjstoreSecretItemsList of Secret Keys and Paths[]
existingServiceAccountName for the existing service account to be shared between the componentsnil
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)nil

Thanos Query parameters

ParameterDescriptionDefault
query.enabledEnable/disable Thanos Query componenttrue
query.logLevelThanos Query log levelinfo
query.replicaLabelReplica indicator(s) along which data is deduplicated[replica]
query.dnsDiscovery.enabledEnable store APIs discovery via DNStrue
query.dnsDiscovery.sidecarsServiceSidecars service name to discover them using DNS discoverynil (evaluated as a template)
query.dnsDiscovery.sidecarsNamespaceSidecars namespace to discover them using DNS discoverynil (evaluated as a template)
query.storesStore APIs to connect with Thanos Query[]
query.sdConfigService Discovery configurationnil
query.existingSDConfigmapName of existing ConfigMap with Ruler configurationnil
query.extraFlagsExtra Flags to passed to Thanos Query[]
query.replicaCountNumber of Thanos Query replicas to deploy1
query.strategyTypeDeployment Strategy TypeRollingUpdate
query.podAntiAffinityPresetThanos Query pod anti-affinity preset. Ignored if query.affinity is set. Allowed values: soft or hardsoft
query.nodeAffinityPreset.typeThanos Query node affinity preset type. Ignored if query.affinity is set. Allowed values: soft or hard""
query.nodeAffinityPreset.keyThanos Query node label key to match Ignored if query.affinity is set.""
query.nodeAffinityPreset.valuesThanos Query node label values to match. Ignored if query.affinity is set.[]
query.affinityThanos Query affinity for pod assignment{} (evaluated as a template)
query.nodeSelectorThanos Query node labels for pod assignment{} (evaluated as a template)
query.tolerationsThanos Query tolerations for pod assignment[] (evaluated as a template)
query.priorityClassNameController priorityClassNamenil
query.securityContext.enabledEnable security context for Thanos Query podstrue
query.securityContext.fsGroupGroup ID for the Thanos Query filesystem

Deploy thanos with OpenTenant

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