Skip to main content
In this guide, we demonstrate how to deploy Grafana Loki using Helm in a Kubernetes cluster. We cover adding and updating the Grafana Helm repository, searching for the appropriate Loki chart, customizing the default configuration values, and finally installing the Loki stack (which includes Loki, Promtail, and Grafana) with minimal manual configuration.

1. Adding and Updating the Grafana Helm Repository

To begin, add the Grafana Helm repository by executing the following command:
You should receive output confirming that the repository has been added:
Next, update your Helm repositories with:
The terminal output will indicate a successful update:
Ensure that your Helm version is up-to-date to prevent compatibility issues with newer charts.

2. Searching for the Loki Chart

Grafana offers several Loki-related charts. To search for these charts within the Grafana repository, run:
You will see output similar to this:
For this deployment, we will use the loki-stack chart, which packages Loki, Promtail, and Grafana for a complete logging solution.

3. Inspecting and Customizing Chart Values

Before installing the chart, it is best practice to review and customize its default configuration. Export the default values to a file named values.yaml:
Open values.yaml in your favorite editor to review the configuration. The file includes sections for Loki, Promtail, Fluent Bit, and Grafana. For instance, the Promtail configuration section may look like this:
This configuration ensures that Promtail is enabled and connected to the Loki server. Note that Fluent Bit is disabled and Grafana is disabled by default. Since Grafana is needed for dashboards, update the configurations as follows:
You can adjust the Grafana image tag if you require a specific version for your environment.

4. Installing the Loki Stack with Helm

With your customized values.yaml in place, install the Loki stack by running:
The installation process will output information similar to the following:
This output verifies that your Loki stack has been successfully deployed. You can now add Loki as a data source in Grafana.

5. Verifying the Deployment

Confirm that all components have been deployed by listing your Kubernetes resources:
A sample output may look like this:
This output confirms the deployment of key components:
  • A StatefulSet for Loki
  • A Deployment (and ReplicaSet) for Grafana
  • A DaemonSet for Promtail, ensuring an instance runs on every node
For multi-node clusters, Promtail will automatically run on every node, ensuring comprehensive log collection.
Once deployed, log in to Grafana to verify that Loki has been automatically added as a data source, simplifying your log monitoring workflow.
By following these steps, you have successfully deployed the Loki stack to your Kubernetes cluster using Helm. This complete logging solution integrates efficient log aggregation with Grafana dashboards for powerful monitoring and troubleshooting. For further reading and additional resources:

Watch Video