Yoke: Introducing the Infrastructure as Code
Package Manager for Kubernetes

Why Yoke?

As the DevOps ecosystem transitions from a focus on DevOps to platform engineering, our tools for interfacing with Kubernetes (K8s) must evolve accordingly. Describing Kubernetes resources through text templates represents the minimum standard we have set. However, it is evident that this approach is not tailored for software engineers. It lacks essential features such as proper type safety, compiler guarantees, validation, testing, autocompletion, and consistent IDE support.

The crucial observation to note is that Kubernetes (K8s) resources differ fundamentally from web pages or emails. So, why do we use templates as if they were? These files represent diverse APIs supported by Kubernetes; in essence, they are structured data. The most effective tools for handling structured data are programming languages.

What is Yoke?

Yoke is a Kubernetes package manager that facilitates the downloading and deployment of packages to Kubernetes. The primary distinction between Yoke and other Kubernetes package managers, such as Helm and Timoni, lies in how Yoke describes Flights (Flights are to Yoke what Charts are to Helm). Unlike Helm and Timoni, where Packages are defined using YAML, CUE, or another configuration language, Yoke utilizes general-purpose code.

Packages or Flights are programs that generate the desired Kubernetes resources in either JSON or YAML format and output them to stdout. Flights are typically packaged as WebAssembly (wasm) executables, with Yoke embedding Wazero, a zero-dependency wasm runtime for Go, to execute these programs. Creating reusable building blocks for Yoke is akin to writing functions or libraries. These components can be distributed and versioned using the respective language's ecosystem package manager, such as npm, cargo, or Go modules. Any language that compiles to wasm enjoys first-class support in Yoke. If your chosen language does not compile to wasm, you can still invoke the program and pipe the output directly to Yoke. However, this approach comes with certain drawbacks, including potential issues related to portability and security.

Getting started

Install the Yoke CLI

From source

go install github.com/davidmdm/yoke/cmd/yoke@latest

Deploy your first package

yoke takeoff my-release https://my-domain.com/example.v1.wasm