Skip to content

johbo/k0s-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k0s-nix Flake

This repository contains a Nix Flake which provides the necessary utilities to use k0s inside of a NixOS system.

Status - EXPERIMENTAL

The implementation is in its early phase. It is possible to use and make work (with a few manual twists) for early inspection.

Contributions

Both contributions and forks are welcome, also if this should ever reach a state which could be integrated upstream into Nixpkgs then I would happy archive this Flake for it.

Usage

Build the test system configuration

nix build .#nixosConfigurations.test.config.system.build.toplevel

Inspect the result in ./result.

Token handling to join the cluster

k0s uses a token to join the cluster. The token has to be placed into /etc/k0s/k0stoken (configurable via services.k0s.tokenFile), otherwise the service will not start.

After the join the content is not needed anymore an the file can be emptied.

Providing the token has to be done either manually or by your favorite automation tooling.

Known limitations

  • k0s is currently included as a binary. It would be better to replicate the build process so that it would be built from sources.

Development and alternatives

Check out the folder docs. It contains further notes about thoughts and internals.

Credit

Contact

Pointers

Projects and Documentation

Other attempts to bring k0s to NixOS