bitnami-containers/bitnami/thanos/docker-compose-cluster.yml

142 lines
3.3 KiB
YAML

version: '2.1'
services:
# Node Exporter
node-exporter:
image: docker.io/bitnami/node-exporter:1
command:
- --web.listen-address=0.0.0.0:9100
# Prepare Prometheus Configuration
prepare-prometheus:
image: docker.io/bitnami/minideb:buster
command:
- /bin/bash
- -ec
- |
cat >'/conf/prometheus.yml'<<'EOF'
global:
scrape_interval: 5s
external_labels:
foo: bar
scrape_configs:
- job_name: node-exporter
static_configs:
- targets:
- node-exporter:9100
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
EOF
volumes:
- 'prom_conf:/conf'
# Prometheus Server
prometheus:
image: docker.io/bitnami/prometheus:2
volumes:
- 'tsdb_data:/opt/bitnami/prometheus/data'
- 'prom_conf:/opt/bitnami/prometheus/conf'
depends_on:
- node-exporter
- prepare-prometheus
# Thanos Sidecar
sidecar:
image: docker.io/bitnami/thanos:0
command:
- sidecar
- --tsdb.path=/data
- --prometheus.url=http://prometheus:9090
- --grpc-address=0.0.0.0:10901
volumes:
- 'tsdb_data:/data'
depends_on:
- query
# MinIO
minio:
image: docker.io/bitnami/minio:2021
ports:
- '9000:9000'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- 'minio_data:/data'
environment:
- MINIO_ROOT_USER=minio
- MINIO_ROOT_PASSWORD=minio123
- MINIO_DEFAULT_BUCKETS=thanos
# Prepare Object Store configuration
prepare-object-store-conf:
image: docker.io/bitnami/minideb:buster
command:
- /bin/bash
- -ec
- |
cat >'/conf/bucket.yml'<<'EOF'
type: s3
config:
bucket: thanos
endpoint: minio:9000
insecure: true
access_key: minio
secret_key: minio123
EOF
volumes:
- 'ojb_store_conf:/conf'
# Thanos Store Gateway
store-gateway:
image: docker.io/bitnami/thanos:0
command:
- store
- --objstore.config-file=/conf/bucket.yml
- --data-dir=/data
- --grpc-address=0.0.0.0:10901
user: "0"
volumes:
- 'ojb_store_conf:/conf'
- 'store_data:/data'
depends_on:
- query
# Thanos Compactor
compactor:
image: docker.io/bitnami/thanos:0
command:
- compact
- --objstore.config-file=/conf/bucket.yml
- --data-dir=/data
user: "0"
volumes:
- 'ojb_store_conf:/conf'
depends_on:
- query
# Thanos Query
query:
image: docker.io/bitnami/thanos:0
command:
- query
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:9090
- --store=sidecar:10901
- --store=store-gateway:10901
ports:
- '9090:9090'
depends_on:
prepare-object-store-conf:
condition: service_started
prometheus:
condition: service_started
minio:
condition: service_healthy
volumes:
prom_conf:
driver: local
tsdb_data:
driver: local
minio_data:
driver: local
ojb_store_conf:
driver: local
store_data:
driver: local