Skip to content

Loki Stack

  • Centralized logs
  • Storage S3 Bucket

artifacthub

Bash
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

Custom Values

YAML
loki:
  env:
    - name: AWS_ACCESS_KEY_ID
      valueFrom:
        secretKeyRef:
          name: durbok
          key: AWS_ACCESS_KEY_ID
    - name: AWS_SECRET_ACCESS_KEY
      valueFrom:
        secretKeyRef:
          name: durbok
          key: AWS_SECRET_ACCESS_KEY
  config:
    schema_config:
      configs:
        - from: 2023-06-13
          store: boltdb-shipper
          object_store: s3
          schema: v11
          index:
            prefix: loki_index_
            period: 24h
    storage_config:
      aws:
        s3: s3://eu-west-1/logs.example.com
        s3forcepathstyle: true
        bucketnames: logs.example.com
        region: eu-west-1
        insecure: false
        sse_encryption: false
      boltdb_shipper:
        shared_store: s3
        cache_ttl: 24h

Deploy

Bash
helm upgrade --install loki --namespace=monitoring -f custom-values.yaml grafana/loki-stack
  • Example secret
Bash
kubectl create secret generic durbok --from-literal=AWS_ACCESS_KEY_ID='AKIXXXXXXXXXXXXXUBD' --from-literal=AWS_SECRET_ACCESS_KEY='65N9Z8XXXXXXXXXX8ayzaWxRy4jkGJA6E' -n monitoring