K3s: Difference between revisions

From NixOS Wiki
imported>Mic92
cleanup
imported>Mic92
add firewall.
Line 5: Line 5:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
{
  # 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.enable = true;
   services.k3s.role = "server";
   services.k3s.role = "server";

Revision as of 20:48, 31 May 2021

K3s is a easier to use version of kubernetes. It bundles all components of a kubernetes cluster into one single binary.

Single node setup

{
  # 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 [
    "--flannel-backend=none"
  ];
}

After enabling you can access you cluster through k3s kubectl i.e. k3s kubectl cluster-info