Closed hansbogert closed 4 years ago
Kubenix is a nix library that allows to build kubernetes manifests using nix expressions. It allows building abstraction thanks to its module system and integrates with the nix ecosystem.
Would this be a means to deploy k8s nodes with immutable kubernetes images, e.g., a k8s master? In a way, would this be an alternative, or have overlap with the functionality of kubeadm? (I don't mean overlap in any negative way!, I'm just trying to figure out where this fits)
No, kubenix allows to describe kubernetes resources such as Deployments, Ingresses, etc.
Althought nixos has support for setting up kubernetes: https://nixos.org/nixos/options.html#kubernetes
I'll add my own "kubenix is like" since hopefully more explanations will help!
The things in the k8s ecosystem that kubenix is most like are the following:
Kubenix is unusual in that it can also use nix
's other features to do things like build docker images as well, which most of those other tools don't deal with.
One other thing that may help you would be to read through the example in the repo.
That shows a nix expression that can be evaluated into a kubectl-applyable kubernetes deployment.
One benefit of writing it in nix instead of in yaml directly is that nix is a much safer language (i.e. indentation doesn't matter), it has handy features like functions, the ability to import / reference things, variables, built-in string templating, etc.
Thank you for the answers, this clears up quite a few things. I was approaching this from the underlay/ infrastructure side.
Coming from a kubernetes background and have little exposure to Nix, what would Kubenix do for me? The term 'resource builder' is not really evident to me.