diff --git a/README.md b/README.md index 9977e76f4813e..c064469c4b988 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,15 @@ $ make loki $ ./cmd/loki/loki -config.file=./cmd/loki/loki-local-config.yaml ``` +To run multiple Loki tenants locally, ensure that auth_enabled is set to true and provide a runtime config with any tenant specific overrides. +```bash +# Build binary +$ make loki + +# Run executable +./loki -config.file=./cmd/loki/loki-local-multi-tenant-config.yaml -runtime-config.file=./cmd/loki/loki-overrides.yaml +``` + To build Promtail on non-Linux platforms, use the following command: ```bash diff --git a/cmd/loki/loki-local-multi-tenant-config.yaml b/cmd/loki/loki-local-multi-tenant-config.yaml new file mode 100644 index 0000000000000..065a7a0ed7d82 --- /dev/null +++ b/cmd/loki/loki-local-multi-tenant-config.yaml @@ -0,0 +1,68 @@ +# auth_enabled is actually turning on multi-tenancy, otherwise all requests get routed to "fake" tenant +auth_enabled: true + +server: + http_listen_port: 3100 + grpc_listen_port: 9096 + log_level: debug + grpc_server_max_concurrent_streams: 1000 + +common: + instance_addr: 127.0.0.1 + path_prefix: /tmp/loki + storage: + filesystem: + chunks_directory: /tmp/loki/chunks + rules_directory: /tmp/loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +query_range: + results_cache: + cache: + embedded_cache: + enabled: true + max_size_mb: 100 + +limits_config: + metric_aggregation_enabled: true + max_global_streams_per_user: 0 + ingestion_rate_mb: 50000 + ingestion_burst_size_mb: 50000 + volume_enabled: true + +schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +pattern_ingester: + enabled: true + metric_aggregation: + loki_address: localhost:3100 + +ruler: + alertmanager_url: http://localhost:9093 + +frontend: + encoding: protobuf + +# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration +# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ +# +# Statistics help us better understand how Loki is used, and they show us performance +# levels for most users. This helps us prioritize features and documentation. +# For more information on what's sent, look at +# https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go +# Refer to the buildReport method to see what goes into a report. +# +# If you would like to disable reporting, uncomment the following lines: +#analytics: +# reporting_enabled: false diff --git a/cmd/loki/loki-overrides.yaml b/cmd/loki/loki-overrides.yaml new file mode 100644 index 0000000000000..79ff1345fb5cb --- /dev/null +++ b/cmd/loki/loki-overrides.yaml @@ -0,0 +1,10 @@ +configs: + '1': + log_push_request: false + log_push_request_streams: false +overrides: + '1': + allow_structured_metadata: true + pattern_persistence_enabled: true + volume_enabled: true + max_query_bytes_read: 1073741824 \ No newline at end of file