> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying Loki in Kubernetes

> Guide to deploying Loki on Kubernetes with Helm charts, selecting deployment modes, configuring durable storage and values.yaml, and installing Grafana and log shippers

Think about the difference between cooking from scratch and using a meal kit.

From scratch, you source every ingredient, measure each one, and hope the proportions are right. A meal kit arrives pre-measured with a recipe card so you just combine a few things and go—there’s far less to get wrong.

Deploying applications into Kubernetes follows the same two paths. Manually you write every Deployment, Service, and ConfigMap for Loki, Alloy, and Grafana. That’s a lot of YAML. Helm is the meal kit: a package that contains the Kubernetes manifests and sensible defaults, letting you override only the values you care about.

```yaml theme={null}
# Typical Kubernetes resource kinds managed by a Helm chart
kind: Service
kind: Deployment
kind: ConfigMap
```

![A simple diagram depicting Helm as a meal kit: an open box with the Helm logo and a "defaults" tag, a separate values.yaml card, and a Kubernetes icon above.](https://mintcdn.com/kodekloud-c4ac6d9a/dEcIUoAxuol-3ZBK/images/Grafana-Loki/Grafana-Loki-on-Kubernetes/Deploying-Loki-in-Kubernetes/helm-mealkit-box-defaults-values-k8s.jpg?fit=max\&auto=format\&n=dEcIUoAxuol-3ZBK\&q=85\&s=bedb751a3627329d7ba6ab303aed0c5d)

A Helm chart packages all the bits for an application and exposes a `values.yaml` file where you override defaults such as image tags, resource requests/limits, and storage backend settings. Historically, there was an `loki-stack` all-in-one chart that bundled Loki, Promtail, and related components; that chart is now deprecated. The community maintains separate charts so each component can be managed independently. Today you’ll find Loki, Grafana, and Alloy charts published across the Grafana and grafana-community Helm repositories.

![A slide titled "Three current charts, two repos" showing three boxed package icons on shelves labeled "loki", "grafana", and "alloy." A "grafana-community" tag appears under the loki and grafana boxes.](https://mintcdn.com/kodekloud-c4ac6d9a/dEcIUoAxuol-3ZBK/images/Grafana-Loki/Grafana-Loki-on-Kubernetes/Deploying-Loki-in-Kubernetes/three-charts-loki-grafana-alloy.jpg?fit=max\&auto=format\&n=dEcIUoAxuol-3ZBK\&q=85\&s=b9465d0bad83a98dc79b6107b92bb5b3)

Add the required Helm repositories and update your local index:

```bash theme={null}
# Add the community and Grafana Helm repositories
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add grafana-community https://grafana-community.github.io/helm-charts
helm repo update
```

Recommended charts and repositories

| Chart | Repository | Typical use |
| - | - | - |
| `loki` | `https://grafana.github.io/helm-charts` | Loki server and related components (query, ingester, storage config) |
| `grafana` | `https://grafana.github.io/helm-charts` | Grafana UI, datasources, dashboards |
| `alloy` | `https://grafana-community.github.io/helm-charts` | Alloy (optional) for curated integrations and dashboards |

Loki’s Helm chart supports multiple deployment topologies to match scale and operational needs:

![Slide titled "Loki's deployment modes" showing three deployment options in boxed cards: SingleBinary ("all of Loki, one process" — learning/small volumes), SimpleScalable ("read, write, and backend targets" — mid-size production), and Distributed ("each component its own service" — large-scale production).](https://mintcdn.com/kodekloud-c4ac6d9a/dEcIUoAxuol-3ZBK/images/Grafana-Loki/Grafana-Loki-on-Kubernetes/Deploying-Loki-in-Kubernetes/loki-deployment-modes-single-simple-distributed.jpg?fit=max\&auto=format\&n=dEcIUoAxuol-3ZBK\&q=85\&s=93dbfcda5d9699abe82aab0aaadecf95)

Deployment modes at a glance

| Mode | What it is | When to use | Chart configuration notes |
| - | - | - | - |
| Single Binary | All Loki components run in one process | Demos, development, very low-volume clusters | Set `loki.mode: singlebinary` in `values.yaml` and configure `storage` for chunks/indices |
| Simple Scalable | Splits read/write/backend roles for better scaling | Mid-size production, predictable scale | Configure `ingester`, `querier`, and `distributor` replicas and persistent storage |
| Distributed | Every component as its own service with independent scaling | Large-scale production with high ingestion/query load | Use distributed storage (S3-compatible) and tune ring/replication settings |

Loki requires durable storage for chunks and indexes. In a lab or on-prem cluster, an S3-compatible store such as MinIO works well; in cloud environments use the managed S3 (or GCS/Azure Blob) backend. The storage backend, endpoint, bucket, credentials, and the deployment mode are all configured in the chart’s `values.yaml`.

For this lesson we will use the Single Binary mode. It’s the simplest to get started with and sufficient for demos and low-volume clusters.

Next steps (quick pointers)

* Edit a local `values.yaml` to set `loki.mode: singlebinary`, configure the `storage` section, and tune resource requests.
* Install Loki with `helm install loki grafana/loki -f values.yaml` (replace `loki` with a release name you prefer).
* Install Promtail or another log shipper to push logs into Loki and add Grafana to visualize logs.

Links and references

* Helm: [https://helm.sh/docs/](https://helm.sh/docs/)
* Loki (Helm chart): [https://github.com/grafana/helm-charts](https://github.com/grafana/helm-charts)
* Grafana Helm charts: [https://github.com/grafana/helm-charts](https://github.com/grafana/helm-charts)
* MinIO: [https://min.io/](https://min.io/)

> **[Watch Video](https://learn.kodekloud.com/user/courses/grafana-loki/module/595f27e5-031e-46ea-bffc-ee1a15f73837/lesson/dd4fae22-039a-414b-b0bc-0509eeb68d94)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.