「Kubernetes」- 部署 Thanos 服务

问题描述

该笔记将记录:通过 Bitnami 提供的 Thanos Helm Chart 来部署 Thanos 服务的方法,以及相关问题的解决办法。

解决方案

helm repo pull bitnami/thanos

helm show values ./thanos-12.0.0.tgz > thanos-12.0.0.helm-values.yaml
vim thanos-12.0.0.helm-values.yaml
...(1)开启 receive、store-gateway 组件;
...(2)配置使用 S3 对象存储;

helm upgrade -n observing-system --install mon-thanos      \
    ./thanos-12.0.0.tgz -f thanos-12.0.0.helm-values.yaml

补充说明

配置写入对象存储:

...
objstoreConfig: |
  type: S3
  config:
    bucket: "infra-mon-prometheus"
    endpoint: "stge.platform.d3rm.org:9000"
    region: ""
    access_key: "9r9elpyKi2mfzoGI"
    insecure: true
    signature_version2: false
    secret_key: "Gv25TS7u5eCXnIjgVvaopl5ceITCnglI"
    http_config:
      idle_conn_timeout: 0s
      insecure_skip_verify: true
...

修改 Prometheus 配置(Remote Write):

  remoteWrite:
  - url: http://mon-thanos-receive:19291/api/v1/receive

参考文献

Thanos/Storage/S3
thanos/quick-tutorial.md at main · thanos-io/thanos