The Missing Kubernetes Type System
danielmangum.com
danielmangum.com
The project that will replace Kubernetes will be something that provides builtins that compose together to EXTEND the system. With such a foundation, you'll be given the flexibility to evolve over time and correct design flaws. Kubernetes was in a rush to beat competitors out in the early orchestration wars, so they focused on primitives that people needed to deploy "today". I think they did a good job, but the focus wasn't on extensibility.
In an ideal world (and I've proposed), there be a long term SIG/WG that experimented with custom controllers to add new primitives that focused on EXTENDING Kubernetes. Most companies at the time wanted to tighten up the core APIs, not realizing that they should be skating towards where the puck is going. Now every major Kubernetes provider is past the point of just getting clusters into folks' hands and are realizing they need to add more functionality, but have no means that doesn't come at the cost of explosive complexity.
The biggest problem with kube is the declarative interfaces aren’t enough for most problems. You need imperative methods as well and the only way to sort of do this is with aggregated API servers (yuck!)
Even the core Pod resource even has a /logs endpoint which is imperative.
Also kubectl is a mess, verb->noun makes no sense at all.
What would you do differently if you could start from scratch?
Full disclosure: I really hate GRPC as a wire protocol.
Loved the concepts though.
See Spin [1], Wasmcloud [2], Lunatic [3], etc.
My system is based on a distributed Webassembly runtime.
The reason for taking inspiration from Kubernetes is making deployment of distributed workloads on that runtime easy.
A nice benefit for a Kubernetes alike system is that the equivalent to operators and controllers can be much more light-weight WASM actors that are easier to develop, deploy and scale.
[1] https://github.com/fermyon/spin
Is the author wanting to move away from K8s' Go style object orientation (structs and functions that act on them) to more of a Java style OO where objects express both data and behaviour?
If I understand the author right, the critique is that Kubernetes wants to present a unified, declarative model for arbitrary orchestration behavior. To do this, it uses controllers/operators/CRDs/etc, but the code within these controllers is often some of the imperativiest-imperativing stuff you've ever seen. This is "fine" for some core primitives, but as you demand more complex orchestrations out of k8s it's more likely you have to write these yourself, and it's messy and "hard", beyond what most teams can or want to invest, because of that.
(Up to this point, I agree fully.)
But then the "types" analogy comes to the fore, and we end up with a system that's even more complex, a kind of HKT for declarative behaviors.
I'm not sure it really solves the implementation problems to begin with, but even if it does - I predict the teams struggling to implement custom operators are going to slam into this new wall even harder trying to model their operational processes like this.
How long until we finally admit a lot of things an operator (human) does are imperative, and therefore the k8s "declarative only" model is fundamentally broken? What we need is more carefully-chosen imperative escape hatches, not more API options.
I agree with all of your points. What is HKT here though?
type Foo implements DeclarativeObject
would work, then you could always add methods on top