From cb1d56158bb8e93e6bfb05ca96ff40aa121a8073 Mon Sep 17 00:00:00 2001 From: Jazzlyn <9011011+jazzlyn@users.noreply.github.com> Date: Sun, 21 Jul 2024 23:08:12 +0200 Subject: [PATCH 1/2] feat(loki): switch to single binary deployment mode --- .../grafana/app/config/datasources.yaml | 2 +- .../observability/loki/app/helm-release.yaml | 61 ++++++------------- .../promtail/app/helm-release.yaml | 2 +- 3 files changed, 19 insertions(+), 46 deletions(-) diff --git a/kubernetes/talos-flux/apps/observability/grafana/app/config/datasources.yaml b/kubernetes/talos-flux/apps/observability/grafana/app/config/datasources.yaml index 8db6a3b53..edfc5210a 100644 --- a/kubernetes/talos-flux/apps/observability/grafana/app/config/datasources.yaml +++ b/kubernetes/talos-flux/apps/observability/grafana/app/config/datasources.yaml @@ -18,7 +18,7 @@ datasources: - name: Loki type: loki access: proxy - url: http://loki-gateway:80/ + url: http://loki:3100/ - name: GitHub type: grafana-github-datasource jsonData: diff --git a/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml b/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml index d2531081a..6678c36b3 100644 --- a/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml +++ b/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml @@ -29,7 +29,7 @@ spec: # https://artifacthub.io/packages/helm/grafana/loki?modal=values # https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml values: - deploymentMode: SimpleScalable + deploymentMode: SingleBinary loki: podAnnotations: secret.reloader.stakater.com/reload: loki-s3 @@ -42,33 +42,17 @@ spec: retention_delete_delay: 2h retention_delete_worker_count: 150 working_directory: /var/loki/compactor/retention - frontend: - max_outstanding_per_tenant: 4096 ingester: chunk_encoding: snappy limits_config: - ingestion_burst_size_mb: 128 - ingestion_rate_mb: 64 - max_query_parallelism: 100 - per_stream_rate_limit: 64M - per_stream_rate_limit_burst: 128M - reject_old_samples: true - reject_old_samples_max_age: 168h retention_period: 30d - shard_streams: - enabled: true - split_queries_by_interval: 1h - query_scheduler: - max_outstanding_requests_per_tenant: 4096 rulerConfig: enable_api: true enable_alertmanager_v2: true alertmanager_url: http://prometheus-alertmanager.observability.svc.cluster.local:9093 #NOSONAR allow http - storage: - type: local - local: - directory: /rules rule_path: /rules/fake + storage: + type: s3 schemaConfig: configs: - from: "2024-04-01" @@ -85,34 +69,15 @@ spec: chunks: loki type: s3 s3: + insecure: false s3ForcePathStyle: true - gateway: - image: - registry: ghcr.io - replicas: 2 - ingress: - # use dedicated ingress definition - enabled: false - service: - labels: - prometheus.io/service-monitor: "false" - - write: - replicas: 2 - persistence: - size: 20Gi - storageClass: openebs-hostpath - - read: - replicas: 2 - extraVolumes: - - name: loki-rules - configMap: - name: loki-alerting-rules - - backend: + singleBinary: replicas: 2 + resources: + requests: + cpu: 10m + memory: 100Mi extraVolumes: - name: loki-rules configMap: @@ -126,6 +91,14 @@ spec: searchNamespace: ALL folder: /rules/fake + backend: + replicas: 0 + read: + replicas: 0 + write: + replicas: 0 + gateway: + enabled: false lokiCanary: enabled: false test: diff --git a/kubernetes/talos-flux/apps/observability/promtail/app/helm-release.yaml b/kubernetes/talos-flux/apps/observability/promtail/app/helm-release.yaml index 2ca985fab..c6db8423d 100644 --- a/kubernetes/talos-flux/apps/observability/promtail/app/helm-release.yaml +++ b/kubernetes/talos-flux/apps/observability/promtail/app/helm-release.yaml @@ -21,7 +21,7 @@ spec: config: clients: - - url: http://loki-gateway/loki/api/v1/push + - url: http://loki/loki/api/v1/push - url: "https://${SECRET_GRAFANA_CLOUD_INSTANCE_ID}:${SECRET_GRAFANA_CLOUD_API_KEY}@logs-prod-us-central1.grafana.net/loki/api/v1/push" serviceMonitor: enabled: true From 4500776924d231096348b6bc86ee7a9ce820acbd Mon Sep 17 00:00:00 2001 From: Jazzlyn <9011011+jazzlyn@users.noreply.github.com> Date: Mon, 30 Sep 2024 00:25:57 +0200 Subject: [PATCH 2/2] feat(loki): adapt config --- .../apps/observability/loki/app/helm-release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml b/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml index f616b25a6..162b42f81 100644 --- a/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml +++ b/kubernetes/talos-flux/apps/observability/loki/app/helm-release.yaml @@ -99,6 +99,10 @@ spec: replicas: 0 gateway: enabled: false + chunksCache: + enabled: false + resultsCache: + enabled: false lokiCanary: enabled: false test: @@ -114,7 +118,7 @@ spec: serviceMonitor: enabled: true metricsInstance: - enabled: false + enabled: true valuesFrom: - kind: Secret