0

I am new to helm , prometheus-grafana and loki services. I have installed loki-stack in my eks cluster through helm chart for log monitoring of my eks pods by using the below command.

helm install loki-stack grafana/loki-stack -n monitoring

loki-chunks folder is getting saved in one of the eks node , which eventually causing high memory consumption. I did some work around that if we can save the chunks folder in s3 bucket or not. I got few answers, that in loki values.yaml file we can mention s3 details for s3 implementation , which is mentioned here How to use S3 as storage for Loki logs?.

But if i am passing the command helm inspect values grafana/loki-stack >> values.yaml I am getting below response.

loki:
  enabled: true
  isDefault: true

promtail:
  enabled: true
  config:
    lokiAddress: http://{{ .Release.Name }}:3100/loki/api/v1/push

fluent-bit:
  enabled: false

grafana:
  enabled: false
  sidecar:
    datasources:
      enabled: true
      maxLines: 1000
  image:
    tag: 8.3.5

prometheus:
  enabled: false
  isDefault: false

filebeat:
  enabled: false
  filebeatConfig:
    filebeat.yml: |
      # logging.level: debug
      filebeat.inputs:
      - type: container
        paths:
          - /var/log/containers/*.log
        processors:
        - add_kubernetes_metadata:
            host: ${NODE_NAME}
            matchers:
            - logs_path:
                logs_path: "/var/log/containers/"
      output.logstash:
        hosts: ["logstash-loki:5044"]

logstash:
  enabled: false
  image: grafana/logstash-output-loki
  imageTag: 1.0.1
  filters:
    main: |-
      filter {
        if [kubernetes] {
          mutate {
            add_field => {
              "container_name" => "%{[kubernetes][container][name]}"
              "namespace" => "%{[kubernetes][namespace]}"
              "pod" => "%{[kubernetes][pod][name]}"
            }
            replace => { "host" => "%{[kubernetes][node][name]}"}
          }
        }
        mutate {
          remove_field => ["tags"]
        }
      }
  outputs:
    main: |-
      output {
        loki {
          url => "http://loki:3100/loki/api/v1/push"
          #username => "test"
          #password => "test"
        }
        # stdout { codec => rubydebug }
      }

I am not getting where to mention the s3 configurations in the above values.yaml file. Can some one help ? It will be really appreciable. Thanks.

Idev.sam
  • 1
  • 2

1 Answers1

0

Not sure yet, but this is the file I used

file aws-basic-config-no-creds2.yaml

loki:
    schema_config:
      configs:
      - from: 2020-05-15
        store: aws
        object_store: s3
        schema: v11
        index:
          prefix: loki_
    storage_config:
      aws:
        s3: s3://eu-central-1/alex-loki-test
    serviceAccount:
        name: loki-sa
        create: true
        annotations: 
            eks.amazonaws.com/role-arn: "arn:aws:iam::1xxx11:instance-profile/loki_s3_role"
grafana:
    enabled: true
    sidecar:
      datasources:
        enabled: true
    image:
      tag:  7.5.17
    grafana.ini:
      users:
        default_theme: dark

Install via

 helm install loki grafana/loki-stack \
  --values aws-basic-config-no-creds2.yaml \
  --namespace loki \
  --create-namespace 
Alex Punnen
  • 5,287
  • 3
  • 59
  • 71