ConfigsJul 24, 2026·3 min read

Grafana Tanka — Jsonnet-Based Kubernetes Configuration

Kubernetes configuration management tool that uses Jsonnet for flexible, reusable, and type-safe cluster resource definitions.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Tanka K8s Config
Direct install command
npx -y tokrepo@latest install cd270c63-86f9-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

Grafana Tanka is a Kubernetes configuration tool that uses Jsonnet as its templating language. Developed by Grafana Labs, it replaces static YAML manifests with programmable Jsonnet code and provides a CLI for diffing, applying, and managing environments.

What Tanka Does

  • Generates Kubernetes manifests from Jsonnet source files
  • Manages multiple environments (dev, staging, production) with shared base configurations
  • Shows diffs between the desired state and the live cluster before applying
  • Integrates with jsonnet-bundler (jb) for dependency management of Jsonnet libraries
  • Exports rendered YAML for use with other deployment tools or GitOps pipelines

Architecture Overview

Tanka evaluates Jsonnet files into a JSON object of Kubernetes resources. Each environment has a main.jsonnet entrypoint and spec.json defining the target cluster. Jsonnet code imports libraries like k8s-libsonnet for typed K8s object constructors. Tanka's CLI evaluates Jsonnet, extracts individual objects, then diffs or applies them via the Kubernetes API.

Self-Hosting & Configuration

  • Single binary (tk) with no daemon or server component
  • Each environment is a directory with spec.json (cluster endpoint, namespace) and main.jsonnet
  • Dependencies managed via jsonnet-bundler (jb) with a jsonnetfile.json manifest
  • Supports inline environments for smaller projects without directory structure
  • Connects to clusters using standard kubeconfig files and kubectl context

Key Features

  • Jsonnet eliminates YAML repetition through variables, functions, and object merging
  • Environment abstraction manages per-cluster differences from a shared code base
  • Native diff command compares rendered output against live cluster state
  • Export mode renders all manifests to static YAML files for GitOps workflows
  • Helm chart support allows importing Helm charts as Jsonnet objects

Comparison with Similar Tools

  • Helm — Template-based with Go templating; Tanka uses Jsonnet which is a full data language
  • Kustomize — Overlay-based YAML patching; Tanka offers richer programmability via Jsonnet
  • Pulumi — General-purpose IaC; Tanka is Kubernetes-focused with Jsonnet
  • cdk8s — Generates K8s manifests from TypeScript/Python; Tanka uses Jsonnet with native diffing

FAQ

Q: Do I need to learn Jsonnet to use Tanka? A: Yes. Jsonnet is Tanka's core language. Its syntax is a superset of JSON, so the learning curve is manageable for developers familiar with JSON.

Q: Can Tanka work alongside Helm? A: Yes. Tanka can import Helm charts and render them as Jsonnet objects, allowing you to combine Helm charts with native Jsonnet configuration.

Q: How does Tanka handle multiple clusters? A: Each environment in Tanka points to a specific cluster via spec.json. You create separate environment directories sharing common Jsonnet libraries but targeting different API servers.

Q: Is Tanka used in production? A: Yes. Grafana Labs uses Tanka to manage their production Kubernetes clusters, and the project is actively maintained.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets