From a65b37f0003166f9837d696017fa7a703a5d22ee Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Wed, 7 Jan 2026 14:55:42 +0000 Subject: [PATCH] Added loki --- k8s/core/prom-stack/grafana-values.yaml | 4 ++ k8s/core/prom-stack/kustomization.yaml | 8 +++ k8s/core/prom-stack/loki-values.yaml | 76 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 k8s/core/prom-stack/loki-values.yaml diff --git a/k8s/core/prom-stack/grafana-values.yaml b/k8s/core/prom-stack/grafana-values.yaml index 9002827..9e23a52 100644 --- a/k8s/core/prom-stack/grafana-values.yaml +++ b/k8s/core/prom-stack/grafana-values.yaml @@ -38,6 +38,10 @@ datasources: url: http://prometheus-kube-prometheus-prometheus.prometheus.svc:9090 access: proxy isDefault: true + - name: Loki + type: loki + url: http://loki-gateway.prometheus.svc:80 + access: proxy ingress: enabled: true diff --git a/k8s/core/prom-stack/kustomization.yaml b/k8s/core/prom-stack/kustomization.yaml index 87742f7..d8b6d78 100644 --- a/k8s/core/prom-stack/kustomization.yaml +++ b/k8s/core/prom-stack/kustomization.yaml @@ -23,3 +23,11 @@ helmCharts: valuesFile: grafana-values.yaml includeCRDs: true + - name: loki + repo: https://grafana.github.io/helm-charts + version: 6.29.0 + releaseName: loki + namespace: prometheus + valuesFile: loki-values.yaml + includeCRDs: true + diff --git a/k8s/core/prom-stack/loki-values.yaml b/k8s/core/prom-stack/loki-values.yaml new file mode 100644 index 0000000..cc994a7 --- /dev/null +++ b/k8s/core/prom-stack/loki-values.yaml @@ -0,0 +1,76 @@ +# Loki SingleBinary mode - оптимально для homelab +deploymentMode: SingleBinary + +loki: + auth_enabled: false + commonConfig: + replication_factor: 1 + path_prefix: /var/loki + schemaConfig: + configs: + - from: 2024-01-01 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + storage: + type: filesystem + filesystem: + chunks_directory: /var/loki/chunks + rules_directory: /var/loki/rules + limits_config: + reject_old_samples: true + reject_old_samples_max_age: 168h + ingestion_rate_mb: 16 + ingestion_burst_size_mb: 32 + max_query_parallelism: 32 + volume_enabled: true + +singleBinary: + replicas: 1 + nodeSelector: + kubernetes.io/hostname: master.tail2fe2d.ts.net + persistence: + enabled: true + size: 50Gi + storageClass: "" + +# Отключаем компоненты для distributed режима +read: + replicas: 0 +write: + replicas: 0 +backend: + replicas: 0 + +# Отключаем memcached (не нужен для SingleBinary) +chunksCache: + enabled: false +resultsCache: + enabled: false + +# Gateway для доступа к Loki +gateway: + enabled: true + replicas: 1 + service: + type: ClusterIP + +# Отключаем тесты и canary +test: + enabled: false +lokiCanary: + enabled: false + +# Мониторинг +monitoring: + dashboards: + enabled: false + rules: + enabled: false + serviceMonitor: + enabled: false + selfMonitoring: + enabled: false