When Tanka and Jsonnet are the right way to deploy Loki
Tanka and Jsonnet are the path Grafana Labs uses to run its own Loki clusters, and the Tanka installation runs Loki in microservices mode, which requires Tanka v0.31.0 or newer. If you run a large Kubernetes estate and need Loki's components scaled independently under version-controlled configuration, this is the path to evaluate first. Confirm the Tanka version your platform team will standardize on against the Loki Tanka docs before you write any code.
Loki documents three deployment modes. Monolithic mode runs as a single binary and is documented for up to about 20 GB of logs per day. Simple scalable mode separates read, write and backend targets and is documented as approaching 1 TB per day, but the Loki documentation states it is being deprecated and will be removed with the Loki 4.0 release, so it is a poor base for a new build. Microservices mode runs each Loki component as its own deployment, which is the design the docs reserve for very large clusters. Each component can be scaled, upgraded and resourced separately, and that independence is what justifies the extra operational load.
Choose this path only if your team can operate Jsonnet libraries, a Tanka workflow and Kubernetes resources as code. Ask whether your organization already reviews infrastructure changes in Git and whether engineers can debug generated manifests. If your daily volume is modest or your team has no Jsonnet experience, a simpler mode or a Helm-based approach may fit better, and the sizing guidance in the sizing topic will help you decide. Record the decision, the Tanka version and the mode you chose before the build starts.
How the Tanka-generated Loki components and proxy fit together
Traffic starts at a client or Alloy and enters through the authenticating reverse proxy, which must set the X-Scope-OrgID header because Loki has no built-in authentication. The distributor hands writes to the ingesters, which persist chunks and index data in object storage. Reads pass through the query frontend to the queriers, while the compactor and ruler work against the same store. Check that nothing reaches Loki without passing the proxy, since that boundary is where tenant identity is decided.
Requests pass the authenticating proxy before reaching Loki's microservices and object storage.
Which deployment path fits your cluster
This table compares Loki's three deployment modes against scale, operational overhead and the situations where each fits, with the object store options alongside. Read it to decide whether the Tanka microservices layout is justified for your daily log volume or whether a smaller mode will serve you. The main takeaway is that the Tanka path targets large clusters, and the simple scalable mode is already deprecated.
| Deployment path | Documented scale | Operational overhead | When it fits |
|---|---|---|---|
| Monolithic (single binary) | Up to about 20 GB of logs per day | Low: one binary and one storage configuration to run and upgrade | Small teams, proofs of concept or low volumes where Tanka's microservices layout is more than you need |
| Simple scalable (read, write, backend) | Approaching 1 TB per day | Medium: three target groups, deprecated and removed with Loki 4.0 | Existing installs that are migrating away; do not choose it for a new Tanka build |
| Microservices (Tanka, Grafana Labs' production layout) | Very large clusters | High: separate components to size, scale, monitor and upgrade through Jsonnet | Large, sustained volumes and teams who can run Tanka and Jsonnet as part of their platform practice |
| Amazon S3 object store | Recommended production option | Low to medium: bucket, IAM role and lifecycle settings to manage | AWS-hosted clusters where chunks and index live in S3 |
| Google Cloud Storage object store | Recommended production option | Low to medium: bucket and IAM settings, plus workload identity | GCP-hosted clusters that keep logs in GCS |
| Azure Blob Storage object store | Recommended production option | Low to medium: storage account, container and identity settings | Azure-hosted clusters that keep logs in Blob Storage |
| MinIO or local filesystem | Supported, not typically recommended for production | Varies: you own durability, backups and capacity | Evaluation environments or on-premises setups only after you confirm durability and backup plans with the storage team |
How to set up Loki with Tanka and jsonnet-bundler
This sequence takes you from an empty workspace to a Loki microservices deployment rendered by Tanka, applied to a non-production cluster, and confirmed to accept pushes and answer queries. Each step ends with a check you can record before moving on.
Confirm Tanka and jsonnet-bundler versions
Install Tanka v0.31.0 or newer on the workstation or CI runner that will render manifests, along with jsonnet-bundler, and confirm both binaries run from the same shell. Check the version output for Tanka against the minimum before going further, because the Loki Tanka installation requires that release or later. Also confirm that your kubectl context points at the non-production cluster you plan to use. The step is complete when both tools report versions and kubectl lists the expected nodes.
Initialize the Tanka environment
Create a project directory, run the Tanka initialization command, and create an environment directory that holds the target cluster's API server and namespace. Keep this environment under version control so every render is traceable to a commit. Confirm the generated files exist and that the environment's main file loads without errors when Tanka evaluates it. The check is a clean evaluation with no Jsonnet errors reported.
Add the Loki jsonnet library
Use jsonnet-bundler to add the Loki library to the project, pinning it to a specific version tag recorded in jsonnetfile.json and the generated lock file. Import the Loki microservices configuration from the library in the environment's main file, following the Loki Tanka installation guide for the exact import paths in your chosen release. Commit the lock file. The check is that jsonnet-bundler resolves the dependency and the vendor directory contains the Loki library.
Set auth_enabled and object storage
In the environment's configuration, set auth_enabled to true so Loki runs in multi-tenant mode and expects an X-Scope-OrgID header on every request. Configure the object storage backend you have chosen for chunks and the index, using a production-recommended store such as Amazon S3, Google Cloud Storage or Azure Blob Storage, and take credentials from your secret store rather than from the file. Record the bucket names and access method in the change request. The check is that the rendered config shows auth_enabled true and the intended storage backend.
Set retention deliberately
Decide whether the compactor should delete data. Retention is disabled by default, so logs are kept indefinitely until retention_enabled is set. Enable it only with the retention periods, global or per-tenant overrides and stream selectors your organization has approved, noting that each stream rule must be at least 24 hours. Write the chosen values into the environment file and review them with the people who own the data policy. The check is a rendered limits block that matches the approved retention decision exactly.
Render and review the manifests
Run Tanka to render the environment into Kubernetes manifests and review the output before anything touches the cluster. Look for the distributor, ingester, querier, query frontend, compactor and gateway components, confirm the storage and auth settings are present, and check that no credentials appear in plain text. Save the rendered output as an artifact for the change record. The check is a complete set of rendered objects with no secret values visible in the diff.
Apply to a non-production cluster
Apply the rendered manifests to the non-production cluster with Tanka, then watch the rollout until the pods reach ready state. Add the authenticating reverse proxy in front of the Loki gateway before any client outside the cluster sends data, because Loki has no built-in authentication layer. Confirm the distributor and ingester ring status is healthy through the Loki status endpoints. The check is a healthy ring and running pods with no crash loops.
Verify ingestion and queries
Send a test push through the proxy with an X-Scope-OrgID header set to a test tenant, then query the same stream back through the query path with the same header. Confirm that a request without the header is rejected or lands in the wrong tenant, which shows tenant isolation is working. Record the test commands and their results in the deployment notes. The check is a successful push, a query that returns the test line, and a rejected request with no tenant header.
Why you must add a reverse proxy for authentication
Loki has no built-in authentication layer, so the Tanka deployment is only as protected as the proxy you place in front of it. The Loki documentation requires an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium. The Tanka-based microservices layout exposes components that accept writes and queries, and the gateway or proxy is the one place where you decide who may reach them. Plan this as a first-class component with its own owner, configuration review and test cases, not as an afterthought added once the cluster is running.
Multi-tenancy is the reason the proxy matters beyond simple login. When auth_enabled is set to true, Loki treats every request as belonging to a tenant identified by the X-Scope-OrgID header. Your proxy must either set that header itself, based on the authenticated identity, or validate the value a client sends. It must never pass through a tenant ID that a client chose freely, because that lets one team read another team's logs. Before go-live, confirm that a user authenticated as tenant A receives an error, not data, when they send a request with tenant B's header, and that Grafana data sources and log shippers each send the header you expect.
Grafana Enterprise Logs is the commercial alternative. It adds token authorization and label-based access control on top of Loki, which can reduce the amount of custom proxy logic you maintain. Whether it fits depends on your licensing, your access model and your review requirements, so confirm the current feature set and terms with Grafana Labs before choosing. Whichever path you take, document how authentication, tenant mapping and access decisions are enforced so your security and compliance reviewers can test them.
Security controls to plan around the Tanka deployment
A Tanka deployment of Loki touches four trust boundaries: the tenant header, cloud object storage, the Kubernetes control plane and the files that describe the cluster. Each card below is a control to decide on before the first apply, with the check that confirms it.
Authenticating proxy and tenant header trust
Loki has no built-in authentication layer, so the reverse proxy in front of it must authenticate every request before Loki sees it. Loki identifies tenants from the X-Scope-OrgID header, which means any client that can reach Loki directly can claim any tenant. Plan the proxy to strip or overwrite that header from incoming requests and to set it only from the authenticated identity. Check that no Service exposes the Loki components outside the cluster, and test that a request without credentials is rejected.
Loki authentication docsObject storage credentials and workload identity
Loki writes chunks and index data to object storage, so the credentials it holds decide what an attacker can read or delete. Prefer the platform identity method the Loki documentation describes for your cloud over static access keys, so pods receive short-lived credentials bound to a service account. Scope the role to the Loki buckets only. Confirm the exact setup for your provider in the Loki storage documentation before writing the Tanka values.
Loki storage docsEncryption at rest for Kubernetes Secrets
Kubernetes stores Secrets unencrypted in etcd by default. Object storage keys, proxy credentials and any tokens that the Tanka manifests reference will sit in that store unless you configure encryption at rest on the API server. Ask your platform team whether encryption at rest is enabled for your cluster, and whether the key is held by a KMS provider. Where possible, pull sensitive values from an external store through the Secrets Store CSI Driver instead of committing them to manifests.
Secrets good practicesLeast-privilege RBAC for the Loki namespace
Anyone who can list or watch Secrets in the Loki namespace can read the object storage and proxy credentials. Restrict list and watch access on Secrets to the service accounts and operators that need it, and grant deployers only the verbs required to apply the Tanka output. Review ClusterRoleBindings that reach the namespace, because broad cluster roles often override a tight namespace design. Check the results against the relevant CIS Kubernetes Benchmark controls for RBAC.
CIS Kubernetes BenchmarkPod Security Standards for the Loki namespace
Loki components run as ordinary workloads, so the namespace should enforce a Pod Security Standard level that blocks privileged containers, host networking and host path mounts. Set the enforcement label on the namespace the Tanka environment deploys into, and confirm that the Loki images and any Alloy collectors pass that level before rollout. Run the containers as non-root where the image allows it. Verify enforcement with a dry-run apply, since a policy failure otherwise surfaces only at pod creation.
Pod Security StandardsKubeconfig and Tanka state in version control
Tanka environments hold cluster endpoints and sometimes credentials, and kubeconfig files grant full cluster access if copied. Keep kubeconfig files and any generated secret values out of the repository, and use a .gitignore entry plus a secret scanning step in CI. Store Jsonnet environment definitions in version control with code review, and require signed or protected branches for changes to the production environment. Ask who can approve a tk apply against production and where that access is logged.
Questions buyers ask before choosing a Tanka Loki deployment
How much does a Tanka-based Loki deployment cost?
The cost comes from four places: the people doing the work, the compute and memory the Loki components run on, the object storage that holds chunks and index data, and the ongoing team time to operate the cluster. Engagement fees are one-time for the build and may be followed by recurring retainers for upgrades and support. Compute and storage are recurring cloud or data center costs that scale with daily log volume and retention length. No public figures exist from DeployOpen, so ask for a written scope that lists the environment, expected ingestion, retention periods, the number of tenants and the deliverables. Then compare the quote against your own infrastructure bills, which you should confirm with your cloud or data center provider.
What drives the cost of running Loki up or down?
Three inputs move the cost most. Daily log volume sets how many ingesters, distributors and queriers you need. Retention length sets how much object storage you pay for, because retention is disabled by default and logs are kept until you enable it. Query load sets how much CPU the queriers and caches consume. Cluster footprint matters too: running on existing Kubernetes capacity costs less than adding dedicated node pools. Label design also affects cost, because high-cardinality streams create more index work. Ask the partner to show how each input was assumed in the quote so you can change one and see the effect.
How long does a Tanka Loki deployment take?
Duration depends on how much of the environment is ready when work starts. The main variables are whether a Kubernetes cluster with enough capacity already exists, whether object storage buckets and access are provisioned, how many tenants and log sources need onboarding, whether the authenticating reverse proxy has an agreed design, and how many review cycles your security team requires. Integration with existing identity systems usually takes longer than the Loki install itself. No duration is given here, so request a timeline in the written scope with the milestones and the client dependencies listed separately.
What does our team need to provide for the work?
Plan for three named responsibilities. First, a Kubernetes owner who can grant namespaces, service accounts, network policy changes and cluster-level permissions. Second, an object storage owner who can create buckets and issue credentials scoped to Loki, and who confirms the storage tier and region. Third, a named owner for the authenticating reverse proxy, such as nginx, HAProxy, OAuth2 Proxy or Pomerium, who decides how users sign in and which identity provider is used. Loki has no built-in authentication, so this owner matters for security sign-off. Your team also needs to decide who receives on-call alerts after handover.
Can our team deploy Loki with Tanka without outside help?
Yes, if your engineers already run Kubernetes in production and are comfortable with Jsonnet, the Tanka tool and jsonnet-bundler. The Loki documentation describes the Tanka installation, which runs Loki in microservices mode and requires Tanka v0.31.0 or newer. The harder parts are usually not the first install. They are configuring object storage securely, designing the proxy and tenant boundaries, sizing the components for your volume, testing retention and deletion, and setting up monitoring and upgrades. A partner adds an outside review of those decisions, a tested build sequence, documentation your auditors can read, and a retest after changes. Teams without Jsonnet experience should budget time to learn it or ask for a scoped handover.
Should we choose Tanka or Helm for Loki on Kubernetes?
Choose Tanka if your platform team already uses Jsonnet, wants one configuration language across services, and is ready to maintain the jsonnet-bundler dependencies. Choose Helm if your organization standardizes on chart values, wants the broadest community examples, or has tooling built around Helm releases. Both paths are documented by Grafana Labs. Tanka is the path the Loki documentation associates with the way Grafana Labs runs its own clusters, so it is a reasonable choice for teams that want to mirror that layout. Make the decision based on the tooling your team will maintain for years, and confirm which path matches your Loki version and upgrade plan before you commit.
Does Loki on Tanka still need a reverse proxy in production?
Yes. Loki has no built-in authentication layer, and its documentation says you must run an authenticating reverse proxy in front of it. Setting auth_enabled to true makes Loki multi-tenant and requires every request to carry an X-Scope-OrgID header, but that header is not a security control on its own. The proxy must authenticate users or systems, decide which tenant they may access, and strip or set tenant headers correctly. Options named in the documentation include nginx, HAProxy, OAuth2 Proxy and Pomerium. Confirm the design with your security team before the build starts, because it determines how audit logs and access reviews are produced.
What runs after the first deployment
After the first deployment, the recurring work is upgrading Loki and its jsonnet library together. In a Tanka setup, the Loki version is pinned by the jsonnet library you import through jsonnet-bundler, so a Loki upgrade is also a library upgrade and a Tanka version check. Confirm the Tanka version your target release requires in the official Tanka installation guide before you change the lock file, and run tk diff against the live cluster to review every changed object before you apply it. Keep the Loki upgrade guide open during the change, because schema and storage settings can change between major versions.
Retention needs deliberate attention because it is off by default. Loki keeps logs indefinitely until retention_enabled is set in the environment's configuration, and the compactor is the component that applies retention. Decide whether you want one global period, per-tenant periods or per-stream selectors, and remember that each stream rule must be at least 24 hours. Record the retention values in the Tanka environment files under version control, so a change is reviewed like any other code change. Per-tenant limits belong in the same review, since they control how much each team can ingest and query.
Monitoring and access review complete the routine. Watch ingestion, query and compactor health through the metrics Loki exposes, and alert on storage growth before it becomes a capacity problem. Because Loki has no built-in authentication, the authenticating reverse proxy you placed in front of it is part of the security boundary, so review its configuration, its identity provider mappings and the X-Scope-OrgID handling at each Loki upgrade and on a fixed schedule set by your security team. Confirm who holds admin rights to the Tanka repository and cluster, since those people can change retention and tenant limits.
How DeployOpen scopes and delivers a Tanka Loki deployment
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For a Tanka and Jsonnet Loki deployment, we start from a written scope covering the microservices layout, object storage, retention, the authenticating reverse proxy and Grafana access, then build and hand over the cluster in your environment.
How we scope
- Confirm the Tanka version, Kubernetes cluster and object store that will host Loki before any build work starts.
- Record expected ingestion, tenant model, retention requirements and which teams and clients will query logs.
- Agree in writing which components, reverse proxy controls, documentation and handover items are included, and what is excluded.
How we build
- Set up the jsonnet-bundler dependencies and Tanka environment files so the microservices configuration is version-controlled in your repository.
- Configure object storage access, compactor retention and the reverse proxy that enforces authentication in front of Loki.
- Test log ingestion, tenant isolation through the X-Scope-OrgID header and query access from Grafana before sign-off.
How we hand over
- Deliver the Jsonnet source, environment configuration and a runbook describing how to render, apply and roll back changes.
- Document the reverse proxy rules, secrets handling, retention settings and the backup and restore steps your team will own.
- Walk your platform and security engineers through the cluster so they can operate, review and upgrade it without us.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Upgrades to newer Loki releases and Tanka changes can be covered in a scoped change or a retainer.
- Ongoing support, upgrades and continuous testing are available as retainers, and a quote follows from the written scope.

