This is documentation for the next version of Loki. For the latest stable release, go to the latest version.
Install the monolithic Helm chart
This Helm Chart installation deploys Grafana Loki in monolithic mode within a Kubernetes cluster.
Prerequisites
- Helm 3 or above. See Installing Helm.
- A running Kubernetes cluster.
Single Replica or Multiple Replicas
There are two ways to deploy Loki in monolithic mode:
- 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.
- 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 specifycommonConfig.replication_factor: 1
if you are only using 1 replica, otherwise requests will fail.
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 thesingleBinary.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.
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
Add Grafana’s chart repository to Helm:
helm repo add grafana https://grafana.github.io/helm-charts
Update the chart repository:
helm repo update
Deploy Loki using the configuration file
values.yaml
:helm install loki grafana/loki -f values.yaml
Install or upgrade the Loki deployment.
- To install:
helm install --values values.yaml loki grafana/loki
- To upgrade:
helm upgrade --values values.yaml loki grafana/loki
- To install:
Verify that Loki is running:
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
andadmin
. 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
- Configure an agent to send log data to Loki.
- Monitor the Loki deployment using the Meta Monitoring Helm chart