Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 24, 2026·3 min de lectura

Grafana Tanka — Jsonnet-Based Kubernetes Configuration

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

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Tanka K8s Config
Comando de instalación directa
npx -y tokrepo@latest install cd270c63-86f9-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

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

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados