diff --git a/src/data/blog/dynamic-airways.md b/src/data/blog/dynamic-airways.md index 4feeb17..4f8bbdb 100644 --- a/src/data/blog/dynamic-airways.md +++ b/src/data/blog/dynamic-airways.md @@ -12,17 +12,6 @@ description: > all without writing YAML. --- - - ## Table of Contents ## Foreword diff --git a/src/data/blog/helm-compatibility.md b/src/data/blog/helm-compatibility.md new file mode 100644 index 0000000..5f93483 --- /dev/null +++ b/src/data/blog/helm-compatibility.md @@ -0,0 +1,362 @@ +--- +author: David Desmarais-Michaud +pubDatetime: 2025-05-07 +title: Yoke and Helm Compatibility +slug: helm-compatibility +workInProgress: true +featured: true +tags: + - yoke + - helm +description: > + Yoke wants to change break away yaml templates but is that break a deal breaker? + Let's explore how Yoke manages to keep backwards compatibility with Helm in a code-first world. +--- + +## Table of Contents + +## Charts and Flights – What's the Difference? + +At the end of the day, both Helm Charts and Yoke Flights are ways to dynamically package Kubernetes resources. + +At an algebraic level, both can be viewed as functions: + +```bash +y = f(x) +``` + +Where the function `f` is the chart or flight, `x` represents the inputs, and `y` is the final set of resources we want to deploy as a single release. + +```bash +# With Helm +resources = helm.chart(values.yaml) + +# With Yoke +resources = yoke.flight(stdin) +``` + +From that perspective, working with Helm or Yoke is about transforming inputs into outputs. The difference lies in how we express that transformation function. + +The Helm transformation function is the Go template engine. We write a number of YAML files, organized as best we see fit, and define one or more resources per file. + +We then use the template engine to express logic: conditionals, loops, and data manipulation via pipelines and Sprig functions to work with strings, maps, and slices. + +In my opinion, this feels like the most straightforward approach when you think about Kubernetes as a collection of YAML documents. +It’s also very practical when your configuration needs are minimal. + +But the cracks start to show almost immediately. + +- Type support between the `values.yaml` file and your templates isn’t always great. +- Templating sections of resources can get complicated and often requires sub-templates. +- And reusable templates are, by nature, stringly typed. +- Function pipelines can be clunky. +- There’s little type safety for the resources you're building. +- control flow is hard to express. +- white space. +- and so on. + +So although we think of Helm as an almost no-code solution, I can't help but feel it’s actually a **poor-code** solution. + +## Reaching for a Better Language + +What most people reach for at this point is the idea of a better configuration language. + +We assume YAML is the problem — that our struggles stem from YAML being bad at expressing configuration. + +So we reach for Jsonnet, CUE, or maybe even Apple’s new PKL. + +And while I do think these tools generally improve the situation — offering benefits like reduced whitespace sensitivity or better-integrated typing — I still believe they miss the mark. + +That’s because, in my view, the problem with Helm Charts isn’t that the _target_ (YAML) is a poor configuration language. +The real issue is that what we _actually want_ is a good way to express a transformation function. Inputs must lead to outputs. + +As a software developer, I can’t help but think that the best way to model a transformation from one type of data to another is... well, a function. + +Just a plain, old, imperative, boring-looking function or program. If this, then do that. Our bread and butter. + +You might disagree on which language or paradigm is best for expressing this kind of transformation. +Maybe a functional language like Haskell is ideal — especially for mapping one type to another, from input to output, from standard input to standard output. + +Or maybe Rust with its blazing speed and memory safety? + +Or Go with its tight integration within the Kubernetes ecosystem? + +**And that’s okay.** + +The larger point is this: the best tools we have for handling structured data and producing structured output are programming languages. + +That’s the position Yoke takes. +Of course, it wouldn’t be feasible to support just _any_ source code, nor would it be safe to execute arbitrary binaries. + +That’s why — as luck would have it — Yoke supports WebAssembly as a shared target for code execution. +It runs in a safe, sandboxed, and predictable environment. + +As long as your programming ecosystem can target WebAssembly, you get first-class support in Yoke. + +## A Tale of Two Ecosystems + +So now that I’ve convinced a small percentage of readers that maybe what they really want is to develop their transformation functions in a type-safe, powerful development ecosystem — and are ready to make the switch — we have to ask the next hard question: + +**What exactly are we buying into? Where is the ecosystem?** + +What can I install, practically speaking? We can definitely build new "charts" as "flights". + +Some things already exist as Flights hosted by the Yoke project — like its "air traffic controller" or "yokecd", a Yoke-extended version of ArgoCD. +That said, the Yoke ecosystem is still new. Adoption is, for now, just a dream on the horizon. The ecosystem still has to be built. + +But what about the existing Helm ecosystem? +If I need Helm just to install Redis, is switching to Yoke even worth it? + +And what about all the internal Charts we use at our organizations? +Does everything need to be ported to code on day one in order to start using Yoke? + +Are we just so trapped by Helm’s gravitational pull that we can never escape its orbit? + +**It sure feels that way.** + +But that’s not the whole story. + +Yoke recognizes that it has no path forward — not even a snowball’s chance in hell — without some degree of interoperability with Helm. + +And fortunately, things just kind of worked out. +Yoke executes code compiled to WebAssembly to transform inputs into outputs. +Helm is written in Go. +Go can be compiled to WebAssembly. + +**Yoke can use Helm.** + +Let’s be clear: Yoke doesn’t use Helm to do package management or deployment. +But users can build Flights that embed Helm Charts and execute them to get their desired resources. + +This means users can extend, combine, and manipulate Charts however they like. + +And — importantly — we can embed our existing Charts into Flights on day one, and _progressively_ port the templating logic over to real code. +This provides a smooth migration path from Charts to Flights, rather than forcing a hard rewrite. + +## Chartered Flights + +