Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3909601
D3407.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D3407.diff
View Options
diff --git a/pillar/services/table.sls b/pillar/services/table.sls
--- a/pillar/services/table.sls
+++ b/pillar/services/table.sls
@@ -40,6 +40,7 @@
white-rabbit: 172.27.27.5
# Observability
+ loki: 172.27.27.35
prometheus: 172.27.27.35
all:
diff --git a/roles/loki/init.sls b/roles/loki/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/loki/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — Provision Loki
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .loki
diff --git a/roles/loki/loki/files/loki.yaml b/roles/loki/loki/files/loki.yaml
new file mode 100644
--- /dev/null
+++ b/roles/loki/loki/files/loki.yaml
@@ -0,0 +1,77 @@
+# -------------------------------------------------------------
+# Loki configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/loki/loki/files/loki.yaml
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Server configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+auth_enabled: false
+
+server:
+ http_listen_port: 3100
+ grpc_listen_port: 9096
+ http_listen_address: "{{ ip }}"
+ grpc_listen_address: "{{ ip }}"
+
+common:
+ instance_addr: "{{ ip }}"
+ path_prefix: /var/db/loki
+ storage:
+ filesystem:
+ chunks_directory: /var/db/loki/chunks
+ rules_directory: /var/db/loki/rules
+ replication_factor: 1
+ ring:
+ kvstore:
+ store: inmemory
+
+# -------------------------------------------------------------
+# Queries
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+query_range:
+ results_cache:
+ cache:
+ embedded_cache:
+ enabled: true
+ max_size_mb: 100
+
+# -------------------------------------------------------------
+# Schema
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+schema_config:
+ configs:
+ - from: 2020-10-24
+ store: boltdb-shipper
+ object_store: filesystem
+ schema: v11
+ index:
+ prefix: index_
+ period: 24h
+
+# -------------------------------------------------------------
+# Alerting
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ruler:
+ alertmanager_url: http://localhost:9093
+
+# -------------------------------------------------------------
+# Disable telemetry
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+analytics:
+ reporting_enabled: false
diff --git a/roles/loki/loki/files/rc/loki.conf b/roles/loki/loki/files/rc/loki.conf
new file mode 100644
--- /dev/null
+++ b/roles/loki/loki/files/rc/loki.conf
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# loki — rc configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/loki/loki/files/rc/loki.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+loki_enable="YES"
diff --git a/roles/loki/loki/init.sls b/roles/loki/loki/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/loki/loki/init.sls
@@ -0,0 +1,43 @@
+# -------------------------------------------------------------
+# Salt — Provision Loki
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# Software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+grafana-loki:
+ pkg.installed
+
+# -------------------------------------------------------------
+# Config
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.etc }}/loki.yaml:
+ file.managed:
+ - source: salt://roles/loki/loki/files/loki.yaml
+ - template: jinja
+ - context:
+ ip: {{ pillar.nasqueron_services.loki }}
+
+# -------------------------------------------------------------
+# Service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+
+/etc/rc.conf.d/loki:
+ file.managed:
+ - source: salt://roles/loki/loki/files/rc/loki.conf
+ - template: jinja
+
+{% endif %}
+
+loki_running:
+ service.running:
+ - name: loki
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -26,6 +26,7 @@
- roles/dbserver-pgsql
- roles/devserver
- roles/grafana
+ - roles/loki
- roles/prometheus
- roles/redis
- roles/saas-nextcloud
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 20:50 (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2306824
Default Alt Text
D3407.diff (5 KB)
Attached To
Mode
D3407: Deploy Grafana Loki
Attached
Detach File
Event Timeline
Log In to Comment