Skip to content

Commit

Permalink
Improve the local config to work locally and inside docker. (#1963)
Browse files Browse the repository at this point in the history
* Improve the local config to work locally and inside docker.

Signed-off-by: Cyril Tovena <[email protected]>

* Add a file specifically for docker loki config.

Signed-off-by: Cyril Tovena <[email protected]>
  • Loading branch information
cyriltovena authored Apr 22, 2020
1 parent be56144 commit 4a208ce
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apk add --update --no-cache ca-certificates libcap \
&& rm -rf /var/cache/apk/*

COPY --from=build /src/loki/cmd/loki/loki /usr/bin/loki
COPY cmd/loki/loki-local-config.yaml /etc/loki/local-config.yaml
COPY cmd/loki/loki-docker-config.yaml /etc/loki/local-config.yaml

RUN setcap cap_net_bind_service=+ep /usr/bin/loki

Expand Down
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM alpine:3.9
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/loki/cmd/loki/loki-debug /usr/bin/loki-debug
COPY --from=build /go/bin/dlv /usr/bin/dlv
COPY cmd/loki/loki-local-config.yaml /etc/loki/local-config.yaml
COPY cmd/loki/loki-docker-config.yaml /etc/loki/local-config.yaml
EXPOSE 3100

# Expose 40000 for delve
Expand Down
55 changes: 55 additions & 0 deletions cmd/loki/loki-docker-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
auth_enabled: false

server:
http_listen_port: 3100

ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
max_transfer_retries: 0

schema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h

storage_config:
boltdb:
directory: /loki/index

filesystem:
directory: /loki/chunks

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h

chunk_store_config:
max_look_back_period: 0s

table_manager:
chunk_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
index_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
retention_deletes_enabled: false
retention_period: 0s
6 changes: 3 additions & 3 deletions cmd/loki/loki-local-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ schema_config:

storage_config:
boltdb:
directory: /loki/index
directory: /tmp/loki/index

filesystem:
directory: /loki/chunks
directory: /tmp/loki/chunks

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h

chunk_store_config:
max_look_back_period: 0
max_look_back_period: 0s

table_manager:
chunk_tables_provisioning:
Expand Down

0 comments on commit 4a208ce

Please sign in to comment.