K3s: Difference between revisions

From NixOS Wiki
imported>Euank
No edit summary
(Category:Container. Link. Description.)
 
(40 intermediate revisions by 19 users not shown)
Line 1: Line 1:
K3s is a easier to use version of kubernetes. It bundles all components of a kubernetes cluster into one single binary.
[https://k3s.io/ K3s] is a simplified Kubernetes version that bundles Kubernetes cluster components into a few small binaries optimized for Edge and IoT devices.  


== Single node setup ==


<syntaxHighlight lang=nix>
NixOS's K3s documentation is available at:
{
  # This is required so that pod can reach the API server (running on port 6443 by default)
  networking.firewall.allowedTCPPorts = [ 6443 ];
  services.k3s.enable = true;
  services.k3s.role = "server";
  services.k3s.extraFlags = toString [
    # "--kubelet-arg=v=4" # Optionally add additional args to k3s
  ];
}
</syntaxHighlight>


After enabling you can access you cluster through <code>k3s kubectl</code> i.e. <code>k3s kubectl cluster-info</code>, or by using the generated kubeconfig file in <code>/etc/rancher/k3s/k3s.yaml</code>
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/cluster/k3s/README.md


== ZFS support ==
[[Category:Container]]
 
k3s's builtin containerd does not support the zfs snapshotter. However it is possible to configure it to use an external containerd:
 
<syntaxHighlight lang=nix>
  virtualisation.containerd.enable = true;
  # TODO describe how to enable zfs snapshotter in containerd
  services.k3s.extraFlags = toString [
    "--container-runtime-endpoint unix:///run/containerd/containerd.sock"
  ];
</syntaxHighlight>

Latest revision as of 21:54, 18 June 2024

K3s is a simplified Kubernetes version that bundles Kubernetes cluster components into a few small binaries optimized for Edge and IoT devices.


NixOS's K3s documentation is available at:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/cluster/k3s/README.md