Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft]: add minio s3 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vs/
.vscode/
.idea/
.data
8 changes: 8 additions & 0 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@
:3000 {
reverse_proxy grafana:3000
}

:9000 {
reverse_proxy minio:9000
}

:9001 {
reverse_proxy minio:9001
}
4 changes: 4 additions & 0 deletions config-minio
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MINIO_ACCESS_KEY=loki
MINIO_SECRET_KEY=supersecret
MINIO_PROMETHEUS_AUTH_TYPE=public
MINIO_UPDATE=off
24 changes: 24 additions & 0 deletions docker-compose.minio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3"

services:

minio:
image: minio/minio
container_name: minio
entrypoint:
- sh
- -euc
- |
mkdir -p /data/loki-data && \
mkdir -p /data/loki-ruler &&
minio server /data
env_file:
- config-minio
ports:
- "9000:9000"
volumes:
- ./.data/minio:/data
restart: always
network_mode: host
labels:
org.label-schema.group: "monitoring"
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ services:
container_name: loki
volumes:
- ./loki/loki-config.yaml:/etc/loki/loki-config.yaml
depends_on:
- minio
command: -config.file=/etc/loki/loki-config.yaml
expose:
- 3100
Expand Down Expand Up @@ -139,6 +141,29 @@ services:
labels:
org.label-schema.group: "monitoring"

minio:
image: minio/minio
container_name: minio
entrypoint:
- sh
- -euc
- |
mkdir -p /data/loki-data && \
mkdir -p /data/loki-ruler &&
minio server /data
env_file:
- config-minio
expose:
- 9000
- 9001
volumes:
- ./.data/minio:/data
restart: always
networks:
- monitor-net
labels:
org.label-schema.group: "monitoring"

caddy:
image: caddy:2.3.0
container_name: caddy
Expand All @@ -149,6 +174,8 @@ services:
- "9093:9093"
- "9091:9091"
- "3100:3100"
- "9000:9000"
- "9001:9001"
volumes:
- ./caddy:/etc/caddy
environment:
Expand Down
37 changes: 30 additions & 7 deletions loki/loki-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,51 @@ server:
common:
path_prefix: /tmp/loki
storage:
filesystem:
chunks_directory: /tmp/loki/chunks
rules_directory: /tmp/loki/rules
replication_factor: 1
s3:
endpoint: minio:9000
insecure: true
bucketnames: loki-data
access_key_id: loki
secret_access_key: supersecret
s3forcepathstyle: true
ring:
instance_addr: 127.0.0.1
instance_addr: 0.0.0.0
kvstore:
store: inmemory
# storage:
# filesystem:
# chunks_directory: /tmp/loki/chunks
# rules_directory: /tmp/loki/rules
# replication_factor: 1
# ring:
# instance_addr: 127.0.0.1
# kvstore:
# store: inmemory

schema_config:
configs:
- from: 2020-10-24
- from: 2021-08-01
store: boltdb-shipper
object_store: filesystem
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
# configs:
# - from: 2020-10-24
# store: boltdb-shipper
# object_store: filesystem
# schema: v11
# index:
# prefix: index_
# period: 24h

limits_config:
ingestion_rate_mb: 1024
ingestion_burst_size_mb: 1024

ruler:
alertmanager_url: http://localhost:9093
storage:
s3:
bucketnames: loki-ruler
1 change: 1 addition & 0 deletions loki/promtail-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ positions:
clients:
# replace "loki" with server address for external hosts
- url: http://loki:3100/loki/api/v1/push
# - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: flog_scrape
Expand Down