Menu

This is documentation for the next version of Loki. For the latest stable release, go to the latest version.

Open source RSS

Install the monolithic Helm chart

This Helm Chart installation deploys Grafana Loki in monolithic mode within a Kubernetes cluster.

Prerequisites

Single Replica or Multiple Replicas

There are two ways to deploy Loki in monolithic mode:

  1. Single Replica: Run Loki with a single replica. This mode is useful for testing and development or if you are planning to run Loki as a meta-monitoring system.
  2. Multiple Replicas: Run Loki with multiple replicas. This mode is useful for high availability. This mode is less economical than microservice mode, but it is simpler to operate. We recommend running at least three replicas for high availability.

Once you have selected how many replicas you would like to deploy, choose the appropriate values.yaml configuration file below and then continue with the deployment steps.

Single Replica

Deploying the Helm chart with a single replica deploys the following components:

  • Loki (1 replica)
  • Loki Canary (1 DaemonSet)
  • Loki Gateway (1 NGINX replica)
  • Loki Chunk and Result Cache (1 DaemonSet)
  • Minio (optional, if minio.enabled=true)

Create the configuration file values.yaml:

Note

You must specify commonConfig.replication_factor: 1 if you are only using 1 replica, otherwise requests will fail.
yaml
loki:
  commonConfig:
    replication_factor: 1
  schemaConfig:
    configs:
      - from: "2024-04-01"
        store: tsdb
        object_store: s3
        schema: v13
        index:
          prefix: loki_index_
          period: 24h
  pattern_ingester:
      enabled: true
  limits_config:
    allow_structured_metadata: true
    volume_enabled: true
    retention_period: 672h # 28 days retention
  compactor:
    retention_enabled: true 
    delete_request_store: s3
  ruler:
    enable_api: true

minio:
  enabled: true
      
deploymentMode: SingleBinary

singleBinary:
  replicas: 1

# Zero out replica counts of other deployment modes
backend:
  replicas: 0
read:
  replicas: 0
write:
  replicas: 0

ingester:
  replicas: 0
querier:
  replicas: 0
queryFrontend:
  replicas: 0
queryScheduler:
  replicas: 0
distributor:
  replicas: 0
compactor:
  replicas: 0
indexGateway:
  replicas: 0
bloomCompactor:
  replicas: 0
bloomGateway:
  replicas: 0

In this configuration, we are deploying Loki with MinIO as the object storage. We recommend configuring object storage via cloud provider or pointing Loki at a MinIO cluster for production deployments.

Multiple Replicas

Deploying the Helm chart with multiple replicas deploys the following components:

  • Loki (3 replicas)
  • Loki Canary (1 DaemonSet)
  • Loki Gateway (1 NGINX replica)
  • Loki Chunk and Result Cache (1 DaemonSet)
  • Minio (optional, if minio.enabled=true)

Create the configuration file values.yaml:

Note

If you set the singleBinary.replicas value to 2 or more, this chart configures Loki to run a single binary in a replicated, highly available mode. When running replicas of a single binary, you must configure object storage.
yaml
loki:
  commonConfig:
    replication_factor: 3
  schemaConfig:
    configs:
      - from: "2024-04-01"
        store: tsdb
        object_store: s3
        schema: v13
        index:
          prefix: loki_index_
          period: 24h
  pattern_ingester:
      enabled: true
  limits_config:
    allow_structured_metadata: true
    volume_enabled: true
    retention_period: 672h # 28 days retention
  compactor:
    retention_enabled: true 
    delete_request_store: s3
  ruler:
    enable_api: true

minio:
  enabled: true
      
deploymentMode: SingleBinary

singleBinary:
  replicas: 3

# Zero out replica counts of other deployment modes
backend:
  replicas: 0
read:
  replicas: 0
write:
  replicas: 0

ingester:
  replicas: 0
querier:
  replicas: 0
queryFrontend:
  replicas: 0
queryScheduler:
  replicas: 0
distributor:
  replicas: 0
compactor:
  replicas: 0
indexGateway:
  replicas: 0
bloomCompactor:
  replicas: 0
bloomGateway:
  replicas: 0

In this configuration, we need to make sure to update the commonConfig.replication_factor and singleBinary.replicas to the desired number of replicas. We are deploying Loki with MinIO as the object storage. We recommend configuring object storage via cloud provider or pointing Loki at a MinIO cluster for production deployments.

Deploying the Helm chart for development and testing

  1. Add Grafana’s chart repository to Helm:

    bash
    helm repo add grafana https://grafana.github.io/helm-charts
  2. Update the chart repository:

    bash
    helm repo update
  3. Deploy Loki using the configuration file values.yaml:

    bash
     helm install loki grafana/loki -f values.yaml
  4. Install or upgrade the Loki deployment.

    • To install:
      bash
      helm install --values values.yaml loki grafana/loki
    • To upgrade:
      bash
      helm upgrade --values values.yaml loki grafana/loki
  5. Verify that Loki is running:

    bash
    kubectl get pods -n loki

Object Storage Configuration

After testing Loki with MinIO, we recommend configuring Loki with an object storage provider. The following examples shows how to configure Loki with different object storage providers:

Caution

When deploying Loki using S3 Storage DO NOT use the default bucket names; chunk, ruler and admin. Choose a unique name for each bucket. For more information see the following security update. This caution does not apply when you are using MinIO. When using MinIO we recommend using the default bucket names.

To configure other storage providers, refer to the Helm Chart Reference.

Deploying the Loki Helm chart to a Production Environment

Note

We are actively working on providing more guides for deploying Loki in production.

We recommend running Loki at scale within a cloud environment like AWS, Azure, or GCP. The below guides will show you how to deploy a minimally viable production environment.

Next Steps