-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# Configuration of the Loki service | ||
apiVersion: addons.metalk8s.scality.com | ||
kind: LokiConfig | ||
spec: | ||
deployment: | ||
replicas: 1 | ||
config: | ||
auth_enabled: false | ||
chunk_store_config: | ||
max_look_back_period: 0s | ||
ingester: | ||
chunk_block_size: 262144 | ||
chunk_idle_period: 3m | ||
chunk_retain_period: 1m | ||
lifecycler: | ||
ring: | ||
kvstore: | ||
store: inmemory | ||
replication_factor: 1 | ||
max_transfer_retries: 0 | ||
limits_config: | ||
enforce_metric_name: false | ||
reject_old_samples: true | ||
reject_old_samples_max_age: 168h | ||
schema_config: | ||
configs: | ||
- from: 2018-04-15 | ||
index: | ||
period: 168h | ||
prefix: index_ | ||
object_store: filesystem | ||
schema: v9 | ||
store: boltdb | ||
server: | ||
http_listen_port: 3100 | ||
storage_config: | ||
boltdb: | ||
directory: /data/loki/index | ||
filesystem: | ||
directory: /data/loki/chunks | ||
table_manager: | ||
retention_deletes_enabled: false | ||
retention_period: 0s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
include: | ||
- .service-configuration | ||
- .loki-configuration-secret | ||
- .chart |
26 changes: 26 additions & 0 deletions
26
salt/metalk8s/addons/logging/loki/deployed/loki-configuration-secret.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% import_yaml 'metalk8s/addons/logging/loki/config/loki.yaml' as loki_defaults with context %} | ||
|
||
{%- set loki = salt.metalk8s_service_configuration.get_service_conf( | ||
'metalk8s-logging', 'metalk8s-loki-config', loki_defaults | ||
) | ||
%} | ||
|
||
Create Loki Configuration Secret: | ||
metalk8s_kubernetes.object_present: | ||
- manifest: | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
app: loki | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: loki | ||
app.kubernetes.io/part-of: metalk8s | ||
chart: loki-0.30.2 | ||
heritage: metalk8s | ||
release: loki | ||
name: loki | ||
namespace: metalk8s-logging | ||
stringData: | ||
loki.yaml: |- | ||
{{ loki.spec.config | tojson }} |
30 changes: 30 additions & 0 deletions
30
salt/metalk8s/addons/logging/loki/deployed/service-configuration.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{%- set loki_config = salt.metalk8s_kubernetes.get_object( | ||
kind='ConfigMap', | ||
apiVersion='v1', | ||
namespace='metalk8s-logging', | ||
name='metalk8s-loki-config', | ||
) | ||
%} | ||
|
||
{%- if loki_config is none %} | ||
|
||
Create metalk8s-loki-config ConfigMap: | ||
metalk8s_kubernetes.object_present: | ||
- manifest: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: metalk8s-loki-config | ||
namespace: metalk8s-logging | ||
data: | ||
config.yaml: |- | ||
apiVersion: addons.metalk8s.scality.com | ||
kind: LokiConfig | ||
spec: {} | ||
|
||
{%- else %} | ||
|
||
metalk8s-loki-config ConfigMap already exist: | ||
test.succeed_without_changes: [] | ||
|
||
{%- endif %} |