Skip to content

Commit

Permalink
ksonnet changes for running loki in single binary (grafana#622)
Browse files Browse the repository at this point in the history
* ksonnet changes for running loki in single bianry
Added retention config with default values

* Fixed indentation
  • Loading branch information
sandeepsukhani authored and slim-bean committed May 31, 2019
1 parent ac9aa9a commit e910059
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
15 changes: 15 additions & 0 deletions cmd/loki/loki-local-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ limits_config:

chunk_store_config:
max_look_back_period: 0

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: 0

2 changes: 1 addition & 1 deletion production/helm/loki-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: loki-stack
version: 0.9.4
version: 0.9.5
appVersion: 0.0.1
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: loki
version: 0.8.3
version: 0.8.4
appVersion: 0.0.1
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
Expand Down
3 changes: 3 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ config:
directory: /data/loki/chunks
chunk_store_config:
max_look_back_period: 0
table_manager:
retention_deletes_enabled: false
retention_period: 0

deploymentStrategy: RollingUpdate

Expand Down
18 changes: 18 additions & 0 deletions production/ksonnet/loki/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
service: 'memcached-client',
},
},
max_look_back_period: 0,
},

schema_config: {
Expand All @@ -122,6 +123,23 @@
},
}],
},

table_manager: {
retention_period: 0,
retention_deletes_enabled: false,
index_tables_provisioning: {
inactive_read_throughput: 0,
inactive_write_throughput: 0,
provisioned_read_throughput: 0,
provisioned_write_throughput: 0,
},
chunk_tables_provisioning: {
inactive_read_throughput: 0,
inactive_write_throughput: 0,
provisioned_read_throughput: 0,
provisioned_write_throughput: 0,
},
},
},
},

Expand Down
4 changes: 1 addition & 3 deletions production/ksonnet/loki/images.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
memcached: 'memcached:1.5.6-alpine',
memcachedExporter: 'prom/memcached-exporter:v0.4.1',

// Our services.
tableManager: 'grafana/cortex-table-manager:r56-bd83f04a',

loki: 'grafana/loki:latest',

distributor: self.loki,
ingester: self.loki,
querier: self.loki,
tableManager: self.loki,
},
}
28 changes: 6 additions & 22 deletions production/ksonnet/loki/table-manager.libsonnet
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
{
local container = $.core.v1.container,

table_manager_args:: {
'bigtable.project': $._config.bigtable_project,
'bigtable.instance': $._config.bigtable_instance,
'chunk.storage-client': $._config.storage_backend,

'dynamodb.original-table-name': '%s_index' % $._config.table_prefix,
'dynamodb.use-periodic-tables': true,
'dynamodb.periodic-table.prefix': '%s_index_' % $._config.table_prefix,
'dynamodb.chunk-table.prefix': '%s_chunks_' % $._config.table_prefix,
'dynamodb.periodic-table.from': $._config.schema_start_date,
'dynamodb.chunk-table.from': $._config.schema_start_date,
'dynamodb.v9-schema-from': $._config.schema_start_date,
// Cassandra / BigTable doesn't use these fields, so set them to zero
'dynamodb.chunk-table.inactive-read-throughput': 0,
'dynamodb.chunk-table.inactive-write-throughput': 0,
'dynamodb.chunk-table.read-throughput': 0,
'dynamodb.chunk-table.write-throughput': 0,
'dynamodb.periodic-table.inactive-read-throughput': 0,
'dynamodb.periodic-table.inactive-write-throughput': 0,
'dynamodb.periodic-table.read-throughput': 0,
'dynamodb.periodic-table.write-throughput': 0,
table_manager_args::
$._config.commonArgs {
target: 'table-manager',
},

table_manager_container::
Expand All @@ -34,7 +16,9 @@
local deployment = $.apps.v1beta1.deployment,

table_manager_deployment:
deployment.new('table-manager', 1, [$.table_manager_container]),
deployment.new('table-manager', 1, [$.table_manager_container]) +
$.config_hash_mixin +
$.util.configVolumeMount('loki', '/etc/loki'),

table_manager_service:
$.util.serviceFor($.table_manager_deployment),
Expand Down

0 comments on commit e910059

Please sign in to comment.