Kubenix 2.0 is in still work in progress, expect breaking changes
Kubernetes resource builder written in nix
KubeNix is a kubernetes resource builder, that uses nix module system for definition of kubernetes resources and nix build system for building complex kubernetes resources very easily.
Edit release.nix, and add a new block for the new version of Kubernetes in generate.k8s. For example:
{
name = "v1.23.nix";
path = generateK8S "v1.23" (builtins.fetchurl {
url = "https://github.com/kubernetes/kubernetes/raw/v1.23.0/api/openapi-spec/swagger.json";
sha256 = "0jivg8nlxka1y7gzqpcxkmbvhcbxynyrxmjn0blky30q5064wx2a";
});
}Run the following command to build the specs:
nix-build release.nix -A generate.k8sFinally, copy all specs from the output of the previous command to modules/generated/.
Putting all this together in one command:
cp $(nix-build --no-out-link release.nix -A generate.k8s)/* modules/generatednix-build release.nix -A test-results --show-traceBuilding single e2e test
nix-build release.nix -A tests.k8s-1_10.testsByName.k8s-crd.test
nix-build release.nix -A tests.k8s-1_10.testsByName.<test-name>.test
Debugging e2e test
nix-build release.nix -A tests.k8s-1_10.testsByName.k8s-crd.test.driver
nix-build release.nix -A tests.k8s-1_10.testsByName.<test-name>.test.driver
resut/bin/nixos-test-driver
testScript;