prometheus-thanos

by Helm

Helm chartv4.9.4App 0.27.0

A Helm chart for thanos monitoring components

About this chart

Prometheus Thanos

Introduction

Thanos is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments.

Thanos leverages the Prometheus 2.0 storage format to cost-efficiently store historical metric data in any object storage while retaining fast query latencies. Additionally, it provides a global query view across all Prometheus installations and can merge data from Prometheus HA pairs on the fly..

Prerequisites

  • Has been tested on Kubernetes 1.11+

Installing the Chart

To install the chart you have to set objStoreConfig. To install the chart with the release name prometheus-thanos, run the following command:

helm install kiwigrid/prometheus-thanos --name prometheus-thanos --values=my-values.yaml

Using Sidecar Configmap Watcher

To enable the sidecar you can set ruler.sidecar.enabled to true. The sidcar will then watch all configmaps and if there is a configmap with label named like ruler.sidecar.watchLabel the sidecar will use the contents inside the config directory of the ruler and will notify the ruler to reload the config files.

An example configmap will look like:

apiVersion: v1
kind: ConfigMap
metadata:
  name: custom-config-map
  labels:
    thanos_alert_config: "1"
data:
  custom-external-rules.yaml: |-
    groups:
    - name: custom_external_rules_group
      rules:
      - alert: custom_alert
        annotations:
          description: "add your desc here"
          summary: "add your summary here"
        expr: up
        for: 10m
        labels:
          severity: warn

Uninstalling the Chart

To uninstall/delete the prometheus-thanos deployment:

helm delete prometheus-thanos

The command removes all the Kubernetes components associated with the chart and deletes the release.

Tip: To completely remove the release, run helm delete --purge prometheus-thanos

Upgrading

This section describes instructions on how to upgrade from a previous version of this chart and breaking changes.

3.x

There was a breaking change in version 3.0.0 which removed the storeGateway.indexCacheSize setting in favour of a storeGateway.indexCache config object. If you're upgrading from a pre-3.0.0 version of this chart, your config needs to adapt the new format.

For example, if you had previously set storeGateway.indexCacheSize to 500MB, you need to set storeGateway.indexCache to the following:

indexCache:
  type: IN-MEMORY
  config:
    max_size: 500MB

All configuration options can be found in the documentation.

4.x

The compactor persistence is now enabled by default and the default PVC size was raised to 10GB.

Configuration

The following table lists the configurable parameters of the prometheus-thanos chart and their default values.

ParameterDescriptionDefault
tracing.enabledControls whether tracing is required across all componentsfalse
tracing.typeThe tracer type. All components which support tracing will use this``
tracing.configConfig for the tracer. All components which support tracing will use this{}
bucketWebInterface.enabledControls whether bucket web interface related resources should be createdfalse
bucketWebInterface.additionalAnnotationsAdditional annotations on bucket web interface pods{}
bucketWebInterface.additionalFlagsAdditional command line flags{}
bucketWebInterface.additionalLabelsAdditional labels on bucket web interface pods{}
bucketWebInterface.affinityAffinity{}
bucketWebInterface.extraEnvExtra env varsnil
bucketWebInterface.httpServerPortThe port to expose from the bucket web interface container10902
bucketWebInterface.image.repositoryDocker image repo for bucket web interfacequay.io/thanos/thanos
bucketWebInterface.image.tagDocker image tag for bucket web interfacev0.27.0
bucketWebInterface.image.pullPolicyDocker image pull policy for bucket web interfaceIfNotPresent
bucketWebInterface.serviceAccount.createCreate service accounttrue
bucketWebInterface.serviceAccount.annotationsService account annotationsnil
bucketWebInterface.logLevelBucket web interface log levelinfo
bucketWebInterface.nodeSelectorNodeSelector{}
bucketWebInterface.objStoreTypeObject store typenil
bucketWebInterface.objStoreConfigConfig for the bucket store{}
bucketWebInterface.objStoreConfigFilePath to config file for the bucket store. Either this or objStoreType + objStoreConfig.nil
bucketWebInterface.podNumericalPriorityEnabledEnables use of the podPriority. Either this or podPriorityClassName.false
bucketWebInterface.podPriorityNumerical value of the pod priority. Enabled by podNumericalPriorityEnabled0
bucketWebInterface.podPriorityClassNameName of the pod priority class to use. Either this or podNumericalPriorityEnabled""
bucketWebInterface.replicaCountReplica count for bucket web interface1
bucketWebInterface.resourcesResources{}
bucketWebInterface.tolerationsTolerations[]
bucketWebInterface.updateStrategyDeployment update strategytype: RollingUpdate
bucketWebInterface.volumeMountsAdditional volume mountsnil
bucketWebInterface.volumesAdditional volumesnil
compact.enabledControls whether compact related resources should be createdtrue
compact.additionalAnnotationsAdditional annotations on compactor pod{}
compact.additionalFlagsAdditional command line flags{}
compact.additionalLabelsAdditional labels on compactor pod{}
compact.affinityAffinity{}
compact.consistencyDelayConsistency delay30m
compact.extraEnvExtra env varsnil
compact.image.repositoryDocker image repo for compactorquay.io/thanos/thanos
compact.image.tagDocker image tag for compactorv0.27.0
compact.image.pullPolicyDocker image pull policy for store gatewayIfNotPresent
compact.serviceAccount.createCreate service accounttrue
compact.serviceAccount.annotationsService account annotationsnil
compact.logLevelStore gateway log levelinfo
compact.nodeSelectorNodeSelector{}
compact.objStoreConfigConfig for the bucket store{}
compact.objStoreConfigFilePath to config file for the bucket store. Either this or objStoreType + objStoreConfig.nil
compact.objStoreTypeObject store typenil
compact.persistentVolume.enabledPersistent volume enabledtrue
compact.persistentVolume.accessModesPersistent volume accessModes[ReadWriteOnce]
compact.persistentVolume.annotationsPersistent volume annotations{}
compact.persistentVolume.existingClaimPersistent volume existingClaim""
compact.persistentVolume.sizePersistent volume size10Gi
compact.persistentVolume.storageClassPersistent volume storage class name""
compact.podNumericalPriorityEnabledEnables use of the podPriority. Either this or podPriorityClassName.false
compact.podPriorityNumerical value of the pod priority. Enabled by podNumericalPriorityEnabled0
compact.podPriorityClassNameName of the pod priority class to use. Either this or podNumericalPriorityEnabled""
compact.resourcesResources{}
compact.retentionResolutionRawRetention for raw buckets30d
compact.retentionResolution5mRetention for 5m buckets30d
compact.retentionResolution1hRetention for 1h buckets10y
compact.tolerationsTolerations[]
compact.updateStrategyStatefulSet update strategytype: RollingUpdate
compact.volumeMountsAdditional volume mountsnil
compact.volumesAdditional volumesnil
querier.enabledControls whether querier related resources should be createdtrue
querier.additionalAnnotationsAdditional annotations on querier pods{}
querier.additionalFlagsAdditional command line flags{}
querier.additionalLabelsAdditional labels on querier pods{}
querier.affinityAffinity{}
querier.autoscaling.enabledControls whether StoreGateway autoscaling is enabledfalse
querier.autoscaling.maxReplicasMaximum number of replicas to scale to10
querier.autoscaling.minReplicasMinimum number of replicas to scale to1
querier.autoscaling.metricsArray of MetricSpecs that will decide whether to scale in or outtarget of 80% for both CPU and memory resources
querier.image.repositoryDocker image repo for querierquay.io/thanos/thanos
querier.image.tagDocker image tag for querierv0.27.0
querier.image.pullPolicyDocker image pull policy for querierIfNotPresent
querier.serviceAccount.createCreate service accounttrue
querier.serviceAccount.annotationsService account annotationsnil
querier.livenessProbe.initialDelaySecondsLiveness probe initialDelaySeconds30
querier.livenessProbe.periodSecondsLiveness probe periodSeconds10
querier.livenessProbe.successThresholdLiveness probe successThreshold1
querier.livenessProbe.timeoutSecondsLiveness probe timeoutSeconds30
querier.logLevelQuerier log levelinfo
querier.nodeSelectorNodeSelector{}
querier.podNumericalPriorityEnabledEnables use of the podPriority. Either this or podPriorityClassName.false
querier.podPriorityNumerical value of the pod priority. Enabled by podNumericalPriorityEnabled0
querier.podPriorityClassNameName of the pod priority class to use. Either this or podNumericalPriorityEnabled""
querier.readinessProbe.initialDelaySecondsReadiness probe initialDelaySeconds30
querier.readinessProbe.periodSecondsReadiness probe periodSeconds10
querier.readinessProbe.successThresholdReadiness probe successThreshold1
querier.readinessProbe.timeoutSecondsReadiness probe timeoutSeconds30
querier.replicaCountReplica count for querier1
querier.replicaLabelsReplica reference labels which are used for query response deduplication[]
querier.resourcesResources{}
querier.storesList of stores see[]
querier.tolerationsTolerations[]
querier.updateStrategyDeployment update strategytype: RollingUpdate
querier.volumeMountsAdditional volume mountsnil
querier.volumesAdditional volumesnil
queryFrontend.enabledControls whether query-frontend related resources should be createdtrue
queryFrontend.additionalAnnotationsAdditional annotations on query-frontend pods{}
queryFrontend.additionalFlagsAdditional command line flags{}
queryFrontend.additionalLabelsAdditional labels on query-frontend pods{}
queryFrontend.affinityAffinity{}
queryFrontend.autoscaling.enabledControls whether query-frontend autoscaling is enabledfalse
queryFrontend.autoscaling.maxReplicasMaximum number of replicas to scale to10
queryFrontend.autoscaling.minReplicasMinimum number of replicas to scale to1
queryFrontend.autoscaling.metricsArray of MetricSpecs that will decide whether to scale in or outtarget of 80% for both CPU and memory resources
queryFrontend.cache.configCaching configurationnil
queryFrontend.cache.enabledControls whether caching should be usedfalse
queryFrontend.cache.typeType of caching seenil
queryFrontend.downstreamUrlThe URL of the querier servicethe default URL of the querier service
queryFrontend.image.repositoryDocker image repo for query-frontendquay.io/thanos/thanos
queryFrontend.image.tagDocker image tag for query-frontendv0.27.0
queryFrontend.image.pullPolicyDocker image pull policy for query-frontendIfNotPresent
queryFrontend.serviceAccount.createCreate service accounttrue
queryFrontend.serviceAccount.annotationsService account annotationsnil
queryFrontend.livenessProbe.initialDelaySecondsLiveness probe initialDelaySeconds30
queryFrontend.livenessProbe.periodSecondsLiveness probe periodSeconds10
queryFrontend.livenessProbe.successThresholdLiveness probe successThreshold1

Deploy prometheus-thanos with OpenTenant

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