38 lines
1 KiB
Nix
38 lines
1 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
# Test swarm for hyperhive's move to k8s. pc2 is the only node for now.
|
|
#
|
|
# kubectl get nodes (as muede, via /etc/rancher/k3s/k3s.yaml)
|
|
#
|
|
# Adding a node later: set `services.k3s.token`/`tokenFile` here, open
|
|
# 6443/tcp, 2379-2380/tcp and 8472/udp, then point the new node's
|
|
# `serverAddr` at pc2. `clusterInit` already makes this an embedded-etcd
|
|
# server so it can grow into an HA control plane.
|
|
services.k3s = {
|
|
enable = true;
|
|
role = "server";
|
|
clusterInit = true;
|
|
|
|
# No ingress/LB baked in: hyperhive brings its own, and servicelb would
|
|
# otherwise grab 80/443 on a desktop.
|
|
disable = [
|
|
"traefik"
|
|
"servicelb"
|
|
];
|
|
|
|
extraFlags = [
|
|
# admin kubeconfig readable by wheel, not the whole machine
|
|
"--write-kubeconfig-mode=0640"
|
|
"--write-kubeconfig-group=wheel"
|
|
];
|
|
};
|
|
|
|
environment = {
|
|
systemPackages = with pkgs; [
|
|
kubectl
|
|
kubernetes-helm
|
|
k9s
|
|
];
|
|
sessionVariables.KUBECONFIG = "/etc/rancher/k3s/k3s.yaml";
|
|
};
|
|
}
|