github.com/thanos-io/thanos@v0.32.5/tutorials/kubernetes-helm/README.md (about)

     1  To deploy thanos sidecar along with Prometheus using official helm chart - just run the next command, putting the values to a file `values.yaml` and changing `--namespace` value beforehand:
     2  
     3  ```
     4  helm upgrade --version="8.6.0" --install --namespace="my-lovely-namespace" --values values.yaml  prometheus-thanos-sidecar stable/prometheus
     5  ```
     6  
     7  Take a note that you need to replace two placeholders in the values: `BUCKET_REPLACE_ME` and `CLUSTER_NAME`. Also adjust all the other values according to your infrastructure requirements.
     8  
     9  An example of the `values.yaml` file:
    10  ```yaml
    11  rbac:
    12    create: true
    13  
    14  alertmanager:
    15    enabled: false
    16  
    17  pushgateway:
    18    enabled: false
    19  
    20  nodeExporter:
    21    enabled: false
    22  
    23  kubeStateMetrics:
    24    enabled: false
    25  
    26  initChownData:
    27    resources:
    28      limits:
    29        memory: 16Mi
    30        cpu: 50m
    31      requests:
    32        memory: 16Mi
    33        cpu: 50m
    34  
    35  server:
    36    extraArgs:
    37      log.level: debug
    38      storage.tsdb.min-block-duration: 2h  # Don't change this, see docs/components/sidecar.md
    39      storage.tsdb.max-block-duration: 2h  # Don't change this, see docs/components/sidecar.md
    40    retention: 4h
    41    service:
    42      annotations:
    43         prometheus.io/scrape: "true"
    44         prometheus.io/port: "9090"
    45    statefulSet:
    46      enabled: true
    47    podAnnotations:
    48      prometheus.io/scrape: "true"
    49      prometheus.io/port: "10902"
    50    affinity:
    51      podAntiAffinity:
    52        requiredDuringSchedulingIgnoredDuringExecution:
    53        - labelSelector:
    54            matchExpressions:
    55            - key: app
    56              operator: In
    57              values:
    58              - prometheus
    59            - key: component
    60              operator: In
    61              values:
    62              - server
    63          topologyKey: "kubernetes.io/hostname"
    64    sidecarContainers:
    65    - name: thanos-sidecar
    66      # Always use explicit image tags (release or main-<date>-sha) instead of ambigous `latest` or `main`.
    67      # Check https://quay.io/repository/thanos/thanos?tab=tags to get latest tag.
    68      image: quay.io/thanos/thanos:main-2021-03-01-1bbad3b5
    69      resources:
    70        requests:
    71          memory: "4Gi"
    72          cpu: "2"
    73        limits:
    74          memory: "4Gi"
    75          cpu: "2"
    76      env:
    77      - name: GOOGLE_APPLICATION_CREDENTIALS
    78        value: /etc/secret/sa
    79      args:
    80      - "sidecar"
    81      - "--log.level=debug"
    82      - "--tsdb.path=/data/"
    83      - "--prometheus.url=http://127.0.0.1:9090"
    84      - "--objstore.config={type: GCS, config: {bucket: BUCKET_REPLACE_ME}}"
    85      - "--reloader.config-file=/etc/prometheus-config/prometheus.yml"
    86      - "--reloader.config-envsubst-file=/etc/prometheus-shared/prometheus.yml"
    87      - "--reloader.rule-dir=/etc/prometheus-config/rules"
    88      ports:
    89      - name: sidecar-http
    90        containerPort: 10902
    91      - name: grpc
    92        containerPort: 10901
    93      - name: cluster
    94        containerPort: 10900
    95      volumeMounts:
    96      - name: storage-volume
    97        mountPath: /data
    98      - name: thanos-storage-secret
    99        mountPath: /etc/secret
   100      - name: config-volume
   101        mountPath: /etc/prometheus-config
   102        readOnly: false
   103      - name: prometheus-config-shared
   104        mountPath: /etc/prometheus-shared/
   105        readOnly: false
   106    configPath: /etc/prometheus-shared/prometheus.yml
   107    replicaCount: 2
   108    persistentVolume:
   109      size: 100Gi
   110    extraVolumes:
   111    - name: prometheus-config-shared
   112      emptyDir: {}
   113    extraVolumeMounts:
   114    - name: prometheus-config-shared
   115      mountPath: /etc/prometheus-shared/
   116    resources:
   117      limits:
   118        cpu: 4
   119        memory: 20Gi
   120      requests:
   121        cpu: 4
   122        memory: 20Gi
   123    global:
   124      scrape_interval: 5s
   125      scrape_timeout: 4s
   126      external_labels:
   127        prometheus_group: CLUSTER_NAME
   128        prometheus_replica: '$(HOSTNAME)'
   129      evaluation_interval: 5s
   130    extraSecretMounts:
   131    - name: thanos-storage-secret
   132      mountPath: /etc/secret/
   133      subPath: sa
   134      readOnly: false
   135      secretName: thanos-storage-secret
   136  
   137  configmapReload:
   138    image:
   139      repository: gcr.io/google-containers/pause-amd64 # This image changed to just pause since there's no option to disable configmapReload container in chart, but thanos-sidecar overtakes this functionality. So basically we don't need another reloader
   140      tag: 3.1
   141    resources:
   142      limits:
   143        cpu: 20m
   144        memory: 20Mi
   145      requests:
   146        cpu: 20m
   147        memory: 20Mi
   148  
   149  
   150  serverFiles:
   151    alerts: {}
   152    rules: {}
   153  
   154  ```