Kubernetes on ARM (Raspberry Pi)

I’m running NixOS on a Raspberry Pi and I want to set up a Kubernetes cluster on it to play around with. On other operating systems (Debian based), I was able to easily do this using k3s.

I tried enabling kubernetes with services.kubernetes.roles = [ "master" "node" ];, but it looks like aarch64 is not supported (errors below). Anyway, I’m looking to add k3s as a Nix package, but the build process seems complicated and involves using Docker to build (I’m new to Nix, so I don’t even know if this is possible to fit into a Nix build). Is there a way to get this build working, or should I try to package up the binary?

More broadly, does anyone have any advice on where to go from here to get Kubernetes running ARM?

Errors below on running Kubernetes, if interested:

error: Package ‘cni-plugins-0.7.1’ in /nix/store/3amy639fz6nixkr2y3kwvirgci57264s-nixos-18.09.2574.a7e559a5504/nixos/pkgs/applications/networking/cluster/cni/plugins.nix:27 is not supported on ‘aarch64-unknown-linux-gnu’, refusing to evaluate.

Even with nixpkgs.config.allowUnsupportedSystem = true;, I still get errors:

error: build of '/nix/store/44vdkbl3f9ijvbpk9jfkdc70rnjldn3x-nixos-system-sentinel-18.09.2574.a7e559a5504.drv' failed
1 Like

Hi nicolas, there is a patch at https://github.com/NixOS/nixpkgs/pull/63603 pending review, which will enable you to cross-compile cni-plugins to ARM. In addition, https://github.com/NixOS/nixpkgs/pull/63604 will relax the platform constraint to allow builds to linux.

1 Like