k3s on pc2
This commit is contained in:
parent
140a4cb063
commit
423e889790
2 changed files with 39 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./gitea-runner.nix
|
./gitea-runner.nix
|
||||||
./hive-ci-runner.nix
|
./hive-ci-runner.nix
|
||||||
|
./k8s-test-swarm.nix
|
||||||
# ./vscode-server.nix
|
# ./vscode-server.nix
|
||||||
# ./hass.nix
|
# ./hass.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
38
nixosConfigurations/muede-pc2/k8s-test-swarm.nix
Normal file
38
nixosConfigurations/muede-pc2/k8s-test-swarm.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue