Using nix to generate k8s yaml is actually quite pleasant. You avoid all the string templating bullshit and can use nix functions and the nixos module system to build proper abstractions.
Is it somewhat convoluted to setup? Absolutely! But it's possible to use relatively robust and well supported built in controllers with custom metrics.
I especially enjoyed where you discovered that K8s runs on string interpolation. That feeling never goes away, FYI; every time you have to play with nindent, you lose a little piece of your sanity.
This is partially a tangent, but the whole managing of software infrastructure is a strange culture. There would of course be lots of better ways, but it's too bad the infrastructure side of the software industry lives partially in a parallel world and many of the lessons from elsewhere in the industry are not really widespread there (at least yet). Even banks seem intelligent and innovative compared to infrastructure management mainstream practices.
It's very error prone to describe a hierarchy of versioned software packages and configuration with shell scripts and yaml. Or use text files in git as a database. Or use the CI system as a bad substitute for a proper service (in order to do a simple thing, you must first create the world from scratch). And so on. Mainstream industry knows types, programming languages, relational databases, graphs and you name it, but those have not yet penetrated sufficiently into the infrastructure world. The understanding of the value of having types has been paid in sweat and blood when developing software and databases. Even a basic CRUD application with a basic SQL database will run rings around these Frankenstein monsters: in safety, speed, and extendability.
> It's very error prone to describe a hierarchy of versioned software packages and configuration with shell scripts and yaml.
We have a multitude of configuration/markup languages all doing the exact same thing.
We have solved this problem in the 60s: S-Expressions. Should have just used that for everything. Configuration, code, websites, you name it. Infinitely extendable, easy to parse.
I'm a lisp nerd, but why do you say sexps are the answer here? I think the point of a lot of configuration formats is that they don't want their configuration to also be a full-fledged programming language.
> I think the point of a lot of configuration formats is that they don't want their configuration to also be a full-fledged programming language.
That seems to be everyone's initial goal, but then it inevitably gets leaky.
I think the dominant split here that forces everything into a weird mismash is that nobody really wants to have to understand arbitrary programming language configs for third-party stuff, they want to read config and know what's going on. BUT for their own stuff, they find reasons to want more power and expressibility...
The point is not how pretty the strings are. The point is there should be no strings at all. These are computer programs, so they should use normal objects. The python code `pod = nignx_pod()` will never fail because the result has too many/too few spaces.
I do thank the advent of LLM's for making the task of tracing through 3 layers of YAML rendering indirection to find an actual bug in layers of insanity. They are surprisingly good at it. A purist might look at the system and be taken aback in horror, but pragmatically the crazy templating things that used to be pretty major in terms of maintainability have become a lot less problematic.
I don't even mind text interpolation in helm that much. Yes, it's horrific, but it really doesn't become problematic until you are having an external system render the text being sent to helm that might be processed again after the fact with Kustomize. Your text might hit literally 3-4 different YAML rendering pipelines before it finally hits your cluster. Insanity
Hashicorp had a similar idea to this configuration language you are mentioning. They named it HCL. We do know how that turned out, but maybe that was more questionable design rather than problems endemic to the approach.
K8s is a reconciliation engine for desired state, like many other adjacent tech in the infra space. Hating on yaml json or tempting layers that drive the engine is kind of silly, and usually missing the point.. like hating dbs because you take issue with a sql layer or an orm layer.
use tofu and hcl.. make it operator and even driven.. use any of many sdks, cdks to drive it, or add a completely different layer for faas or orchestration if that’s the relevant vocab for your problem space. It all runs on k8s.. that’s kinda the point.
Using nix to generate k8s yaml is actually quite pleasant. You avoid all the string templating bullshit and can use nix functions and the nixos module system to build proper abstractions.
> Basically, Horizontal Pod Autoscaler but with sensors which are not just "CPU"
Since Kubernetes 1.23, there's support for using "custom metrics" to control HPAs: https://kubernetes.io/blog/2026/07/14/custom-metrics-exporte...
Is it somewhat convoluted to setup? Absolutely! But it's possible to use relatively robust and well supported built in controllers with custom metrics.
> Is it somewhat convoluted to setup? Absolutely!
Kubernetes™
The node equivalent, also very useful for engineering cost effective cloud environments, is called KEDA.
I especially enjoyed where you discovered that K8s runs on string interpolation. That feeling never goes away, FYI; every time you have to play with nindent, you lose a little piece of your sanity.
This is partially a tangent, but the whole managing of software infrastructure is a strange culture. There would of course be lots of better ways, but it's too bad the infrastructure side of the software industry lives partially in a parallel world and many of the lessons from elsewhere in the industry are not really widespread there (at least yet). Even banks seem intelligent and innovative compared to infrastructure management mainstream practices.
It's very error prone to describe a hierarchy of versioned software packages and configuration with shell scripts and yaml. Or use text files in git as a database. Or use the CI system as a bad substitute for a proper service (in order to do a simple thing, you must first create the world from scratch). And so on. Mainstream industry knows types, programming languages, relational databases, graphs and you name it, but those have not yet penetrated sufficiently into the infrastructure world. The understanding of the value of having types has been paid in sweat and blood when developing software and databases. Even a basic CRUD application with a basic SQL database will run rings around these Frankenstein monsters: in safety, speed, and extendability.
> It's very error prone to describe a hierarchy of versioned software packages and configuration with shell scripts and yaml.
We have a multitude of configuration/markup languages all doing the exact same thing.
We have solved this problem in the 60s: S-Expressions. Should have just used that for everything. Configuration, code, websites, you name it. Infinitely extendable, easy to parse.
I'm a lisp nerd, but why do you say sexps are the answer here? I think the point of a lot of configuration formats is that they don't want their configuration to also be a full-fledged programming language.
> I think the point of a lot of configuration formats is that they don't want their configuration to also be a full-fledged programming language.
That seems to be everyone's initial goal, but then it inevitably gets leaky.
I think the dominant split here that forces everything into a weird mismash is that nobody really wants to have to understand arbitrary programming language configs for third-party stuff, they want to read config and know what's going on. BUT for their own stuff, they find reasons to want more power and expressibility...
> they don't want their configuration to also be a full-fledged programming language.
They say they don't want it but every configurmation format eventually ends up becoming turing complete at some point.
You can do JSON instead of YAML.
But no one does that because it is significantly uglier. So I guess we don't deserve sanity because we don't want our programs to be ugly?
The point is not how pretty the strings are. The point is there should be no strings at all. These are computer programs, so they should use normal objects. The python code `pod = nignx_pod()` will never fail because the result has too many/too few spaces.
Wait, but how does that help? Are text templates any better suited for creating JSON than they are for creating YAML?
I definitely prefer using kustomize over helm, where the mentioned interpolation takes place.
I've written at length about my disdain for text interpolation in helm.
I've done some experiments using Apple's Pkl and CNCF's KCL, which look to solve these problems with a simple "configuration language".
I don't think either have very widespread adoption, though I did hear a while back that Apple is using Pkl internally.
I do thank the advent of LLM's for making the task of tracing through 3 layers of YAML rendering indirection to find an actual bug in layers of insanity. They are surprisingly good at it. A purist might look at the system and be taken aback in horror, but pragmatically the crazy templating things that used to be pretty major in terms of maintainability have become a lot less problematic.
I don't even mind text interpolation in helm that much. Yes, it's horrific, but it really doesn't become problematic until you are having an external system render the text being sent to helm that might be processed again after the fact with Kustomize. Your text might hit literally 3-4 different YAML rendering pipelines before it finally hits your cluster. Insanity
Hashicorp had a similar idea to this configuration language you are mentioning. They named it HCL. We do know how that turned out, but maybe that was more questionable design rather than problems endemic to the approach.
K8s is a reconciliation engine for desired state, like many other adjacent tech in the infra space. Hating on yaml json or tempting layers that drive the engine is kind of silly, and usually missing the point.. like hating dbs because you take issue with a sql layer or an orm layer.
use tofu and hcl.. make it operator and even driven.. use any of many sdks, cdks to drive it, or add a completely different layer for faas or orchestration if that’s the relevant vocab for your problem space. It all runs on k8s.. that’s kinda the point.
Using literally anything other than helm will make your life 100x better with k8s.
Kubernetes vs SLURM: https://slurm.schedmd.com/SC23/Slurm-and-or-vs-Kubernetes.pd...
> Basically, Horizontal Pod Autoscaler but with sensors which are not just "CPU"
I think you found the answer to that below - KEDA
Thanks for writing this up. The prose was really pleasant to read, a treat in this day.
YAML abstracting YAML abstracting YAML abstracting..
I hate it so much. I got moved from a software role to a devops/platform engineering role after some contract shifts and it's miserable.
At least some years ago, I could cope by viewing it as "resume fodder" but that doesn't even matter anymore.