From 121f15a9337f81efe11c2532df0ab0f4067a63e1 Mon Sep 17 00:00:00 2001 From: makefunstuff Date: Sat, 29 Jun 2024 15:24:57 +0300 Subject: loki ftw --- cd/tools.yaml | 2 ++ tools/grafana/values.yaml | 10 +++--- tools/loki-promtail/Chart.yaml | 12 ++++++++ tools/loki-promtail/values.yaml | 67 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 tools/loki-promtail/Chart.yaml create mode 100644 tools/loki-promtail/values.yaml diff --git a/cd/tools.yaml b/cd/tools.yaml index 7cdd906..093dbb8 100644 --- a/cd/tools.yaml +++ b/cd/tools.yaml @@ -11,6 +11,8 @@ spec: path: tools/grafana - chart: prometheus path: tools/prometheus + - chart: loki-promtail + path: tools/loki-promtail template: metadata: name: '{{chart}}' diff --git a/tools/grafana/values.yaml b/tools/grafana/values.yaml index c98c428..8a62712 100644 --- a/tools/grafana/values.yaml +++ b/tools/grafana/values.yaml @@ -42,10 +42,8 @@ grafana: access: proxy url: http://prometheus-server.monitoring.svc.cluster.local isDefault: true - - name: Elasticsearch - type: elasticsearch + - name: Loki + type: loki + url: http://loki:3100 access: proxy - url: http://elasticsearch-master.monitoring.svc.cluster.local:9200 - jsonData: - esVersion: 7 - timeField: "@timestamp" + isDefault: true diff --git a/tools/loki-promtail/Chart.yaml b/tools/loki-promtail/Chart.yaml new file mode 100644 index 0000000..4b039ea --- /dev/null +++ b/tools/loki-promtail/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: loki-promtail +description: A Helm chart for deploying Loki and Promtail +version: 0.1.0 +dependencies: + - name: loki + version: 6.6.4 + repository: "https://grafana.github.io/helm-charts" + - name: promtail + version: 6.16.2 + repository: "https://grafana.github.io/helm-charts" + diff --git a/tools/loki-promtail/values.yaml b/tools/loki-promtail/values.yaml new file mode 100644 index 0000000..4db011d --- /dev/null +++ b/tools/loki-promtail/values.yaml @@ -0,0 +1,67 @@ +loki: + fullnameOverride: loki + persistence: + enabled: true + storageClassName: "standard" + accessModes: + - ReadWriteOnce + size: 10Gi + resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "500m" + memory: "512Mi" + config: + schema_config: + configs: + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 168h + storage_config: + boltdb_shipper: + active_index_directory: /var/loki/index + cache_location: /var/loki/cache + cache_ttl: 24h + shared_store: filesystem + filesystem: + directory: /var/loki/chunks + limits_config: + enforce_metric_name: false + reject_old_samples: true + reject_old_samples_max_age: 168h + +promtail: + fullnameOverride: promtail + config: + clients: + - url: http://loki:3100/loki/api/v1/push + positions: + filename: /run/promtail/positions.yaml + scrape_configs: + - job_name: system + static_configs: + - targets: + - localhost + labels: + job: varlogs + __path__: /var/log/*log + resources: + requests: + cpu: "50m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" + persistence: + enabled: true + storageClassName: "standard" + accessModes: + - ReadWriteOnce + size: 5Gi + -- cgit 1.4.1-2-gfad0