Skip to content

Jsonnet Kubernetes library

The Jsonnet Kubernetes library is a generated with k8s from the OpenAPI specification (swagger.json) of the Kubernetes API.

Currently, artifacts for the following Kubernetes versions are provided:


What is this?

This is a Jsonnet library that helps the Jsonnet user create Kubernetes objects such as Deployment as concisely as possible.

For example, this YAML:

apiVersion: apps/v1
kind: Deployment
  name: foo
  replicas: 1
        app: name
        - image: foo/bar
          name: foo

can be rendered with this jsonnet:

  local k = (import ""),
  foo:"foo", containers=["foo", image="foo/bar")

This library works particularly well with Grafana Tanka, as Tanka is designed to ease the use of Jsonnet with Kubernetes clusters.

Relationship to ksonnet-lib

ksonnet-lib was a similar library to this. However, as a part of the now deprecated ksonnet project, it has not seen much love in recent days.

To continue the success story, community members (especially teams of Grafana Labs and RedHat OpenShift) decided to pick up the challenge of creating this fresh, more modern and future proof replacement for ksonnet-lib.