Docs: Improve/update examples page (#8338)

What this PR does / why we need it:
Update our examples page to reflect recent changes to Loki configuration.
Motivated by feedback on #6122
k135
Dylan Guedes 3 years ago committed by GitHub
parent 6b8a37da58
commit f2d7bb4c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 196
      docs/sources/configuration/examples.md
  2. 22
      docs/sources/configuration/examples/1-Local-Configuration-Example.yaml
  3. 45
      docs/sources/configuration/examples/2-S3-Cluster-Example.yaml
  4. 0
      docs/sources/configuration/examples/3-S3-Without-Credentials-Snippet.yaml
  5. 0
      docs/sources/configuration/examples/4-BOS-Example.yaml
  6. 0
      docs/sources/configuration/examples/5-S3-And-DynamoDB-Snippet.yaml
  7. 0
      docs/sources/configuration/examples/6-Cassandra-Snippet.yaml
  8. 2
      docs/sources/configuration/examples/7-Schema-Migration-Snippet.yaml
  9. 0
      docs/sources/configuration/examples/8-GCS-Snippet.yaml
  10. 0
      docs/sources/configuration/examples/9-Expanded-S3-Snippet.yaml
  11. 70
      docs/sources/configuration/examples/almost-zero-dependency.yaml
  12. 37
      docs/sources/configuration/examples/complete-local-config.yaml
  13. 18
      docs/sources/configuration/examples/s3-compatible-apis.yaml

@ -4,49 +4,58 @@ description: Loki Configuration Examples
---
# Examples
## almost-zero-dependency.yaml
## 1-Local-Configuration-Example.yaml
```yaml
# This is a configuration to deploy Loki depending only on a storage solution
# for example, an S3-compatible API like MinIO.
# The ring configuration is based on the gossip memberlist and the index is shipped to storage
# via Single Store (boltdb-shipper)
auth_enabled: false
server:
http_listen_port: 3100
distributor:
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
store: inmemory
replication_factor: 1
path_prefix: /tmp/loki
ingester:
lifecycler:
ring:
kvstore:
store: memberlist
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
```
memberlist:
abort_if_cluster_join_fails: false
# Expose this port on all distributor, ingester
# and querier replicas.
bind_port: 7946
## 2-S3-Cluster-Example.yaml
# You can use a headless k8s service for all distributor,
# ingester and querier components.
join_members:
- loki-gossip-ring.loki.svc.cluster.local:7946
```yaml
# This is a complete configuration to deploy Loki backed by a s3-Comaptible API
# like MinIO for storage. Loki components will use memberlist ring to shard and
# the index will be shipped to storage via boltdb-shipper.
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
replication_factor: 1
path_prefix: /loki # Update this accordingly, data will be stored here.
max_join_backoff: 1m
max_join_retries: 10
min_join_backoff: 1s
memberlist:
join_members:
# You can use a headless k8s service for all distributor, ingester and querier components.
- loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.
schema_config:
configs:
@ -63,24 +72,18 @@ storage_config:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: s3
aws:
s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
s3forcepathstyle: true
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
compactor:
working_directory: /data/compactor
working_directory: /loki/compactor
shared_store: s3
compaction_interval: 5m
```
## aws-basic-config-no-creds.yaml
## 3-S3-Without-Credentials-Snippet.yaml
```yaml
# If you don't wish to hard-code S3 credentials you can also configure an EC2
@ -103,29 +106,7 @@ storage_config:
```
## aws-basic-config.yaml
```yaml
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
```
## bos-config.yaml
## 4-BOS-Example.yaml
```yaml
schema_config:
@ -156,83 +137,60 @@ compactor:
```
## cassandra-index.yaml
## 5-S3-And-DynamoDB-Snippet.yaml
```yaml
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage
schema_config:
configs:
- from: 2020-05-15
store: cassandra
object_store: filesystem
store: aws
object_store: s3
schema: v11
index:
prefix: cassandra_table
period: 168h
prefix: loki_
storage_config:
cassandra:
username: cassandra
password: cassandra
addresses: 127.0.0.1
auth: true
keyspace: lokiindex
filesystem:
directory: /tmp/loki/chunks
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
```
## complete-local-config.yaml
## 6-Cassandra-Snippet.yaml
```yaml
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
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage
schema_config:
configs:
- from: 2020-05-15
store: boltdb
store: cassandra
object_store: filesystem
schema: v11
index:
prefix: index_
prefix: cassandra_table
period: 168h
storage_config:
boltdb:
directory: /tmp/loki/index
cassandra:
username: cassandra
password: cassandra
addresses: 127.0.0.1
auth: true
keyspace: lokiindex
filesystem:
directory: /tmp/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
```
## example-schema-config.yaml
## 7-Schema-Migration-Snippet.yaml
```yaml
# Additional example schema configuration for Cassandra
schema_config:
configs:
# Starting from 2018-04-15 Loki should store indexes on Cassandra
@ -258,7 +216,7 @@ schema_config:
```
## google-cloud-storage-config.yaml
## 8-GCS-Snippet.yaml
```yaml
# This partial configuration uses GCS for chunk storage and uses BigTable for index storage
@ -283,31 +241,7 @@ storage_config:
```
## s3-compatible-apis.yaml
```yaml
# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used.
# If the API supports path-style URLs rather than virtual hosted bucket addressing,
# configure the URL in `storage_config` with the custom endpoint
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
```
## s3-expanded-config.yaml
## 9-Expanded-S3-Snippet.yaml
```yaml
# S3 configuration supports an expanded configuration.

@ -0,0 +1,22 @@
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
replication_factor: 1
path_prefix: /tmp/loki
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h

@ -0,0 +1,45 @@
# This is a complete configuration to deploy Loki backed by a s3-Comaptible API
# like MinIO for storage. Loki components will use memberlist ring to shard and
# the index will be shipped to storage via boltdb-shipper.
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
replication_factor: 1
path_prefix: /loki # Update this accordingly, data will be stored here.
memberlist:
join_members:
# You can use a headless k8s service for all distributor, ingester and querier components.
- loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: s3
aws:
s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
s3forcepathstyle: true
compactor:
working_directory: /loki/compactor
shared_store: s3
compaction_interval: 5m

@ -1,5 +1,3 @@
# Additional example schema configuration for Cassandra
schema_config:
configs:
# Starting from 2018-04-15 Loki should store indexes on Cassandra

@ -1,70 +0,0 @@
# This is a configuration to deploy Loki depending only on a storage solution
# for example, an S3-compatible API like MinIO.
# The ring configuration is based on the gossip memberlist and the index is shipped to storage
# via Single Store (boltdb-shipper)
auth_enabled: false
server:
http_listen_port: 3100
distributor:
ring:
kvstore:
store: memberlist
ingester:
lifecycler:
ring:
kvstore:
store: memberlist
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
memberlist:
abort_if_cluster_join_fails: false
# Expose this port on all distributor, ingester
# and querier replicas.
bind_port: 7946
# You can use a headless k8s service for all distributor,
# ingester and querier components.
join_members:
- loki-gossip-ring.loki.svc.cluster.local:7946
max_join_backoff: 1m
max_join_retries: 10
min_join_backoff: 1s
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: s3
aws:
s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
s3forcepathstyle: true
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
compactor:
working_directory: /data/compactor
shared_store: s3
compaction_interval: 5m

@ -1,37 +0,0 @@
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
schema_config:
configs:
- from: 2020-05-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h
storage_config:
boltdb:
directory: /tmp/loki/index
filesystem:
directory: /tmp/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h

@ -1,18 +0,0 @@
# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used.
# If the API supports path-style URLs rather than virtual hosted bucket addressing,
# configure the URL in `storage_config` with the custom endpoint
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
Loading…
Cancel
Save