Added k3s
This commit is contained in:
parent
b8daaffbd0
commit
9403421b79
1 changed files with 47 additions and 0 deletions
47
config/k3s.nix
Normal file
47
config/k3s.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
myhostname,
|
||||
...
|
||||
}:
|
||||
let
|
||||
in
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
6443 # k3s: required so that pods can reach the API server (running on port 6443 by default)
|
||||
5173
|
||||
# 2379 # k3s, etcd clients: required if using a "High Availability Embedded etcd" configuration
|
||||
# 2380 # k3s, etcd peers: required if using a "High Availability Embedded etcd" configuration
|
||||
];
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
role = "server";
|
||||
extraFlags = toString ([
|
||||
"--write-kubeconfig-mode \"0644\""
|
||||
"--cluster-init"
|
||||
"--disable servicelb"
|
||||
"--disable traefik"
|
||||
"--disable local-storage"
|
||||
]);
|
||||
clusterInit = true;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
|
||||
];
|
||||
|
||||
services.openiscsi = {
|
||||
enable = true;
|
||||
name = "iqn.2016-04.com.open-iscsi:${myhostname}";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
k3s
|
||||
cifs-utils
|
||||
nfs-utils
|
||||
git
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue