mirror of
https://github.com/JuLi0n21/publicConfig.git
synced 2026-04-19 16:00:08 +00:00
add k3s services
This commit is contained in:
31
hosts/k3s-nixos-02/k3s.nix
Normal file
31
hosts/k3s-nixos-02/k3s.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
k3s
|
||||
];
|
||||
|
||||
environment.sessionVariables = {
|
||||
KUBECONFIG = "$HOME/.kube/config";
|
||||
};
|
||||
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
role = "agent";
|
||||
serverAddr = "https://192.168.1.89:6443";
|
||||
tokenFile = "/var/lib/rancher/k3s/agent/token";
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 10250 22 ];
|
||||
allowedUDPPorts = [ 8472 ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user