Add kube-proxy.

This commit is contained in:
Tom Alexander
2025-12-16 21:07:39 -05:00
parent abae26ed17
commit 988a1673b3
12 changed files with 185 additions and 65 deletions

View File

@@ -8,8 +8,6 @@
let
# shellCommand = cmd: (lib.concatMapStringsSep " " lib.strings.escapeShellArg cmd);
shellCommand = cmd: (builtins.concatStringsSep " " cmd);
settingsFormat = pkgs.formats.yaml { };
config_file = settingsFormat.generate "kubelet-config.yaml" config.me.kubelet.settings;
in
{
imports = [ ];
@@ -21,46 +19,6 @@ in
example = true;
description = "Whether we want to install kubelet.";
};
kubelet.settings = lib.mkOption {
type = settingsFormat.type;
default = {
kind = "KubeletConfiguration";
apiVersion = "kubelet.config.k8s.io/v1beta1";
address = "0.0.0.0";
authentication = {
anonymous = {
enabled = false;
};
webhook = {
enabled = true;
};
x509 = {
clientCAFile = "/var/lib/kubelet/ca.crt";
};
};
authorization = {
mode = "Webhook";
};
cgroupDriver = "systemd";
containerRuntimeEndpoint = "unix:///var/run/containerd/containerd.sock";
enableServer = true;
failSwapOn = false;
maxPods = 16;
memorySwap = {
swapBehavior = "NoSwap";
};
port = 10250;
resolvConf = "/etc/resolv.conf";
registerNode = true;
runtimeRequestTimeout = "15m";
tlsCertFile = "/var/lib/kubelet/kubelet.crt";
tlsPrivateKeyFile = "/var/lib/kubelet/kubelet.key";
};
description = ''
kubelet-config.yaml
'';
};
};
config = lib.mkIf config.me.kubelet.enable {
@@ -79,9 +37,8 @@ in
ExecStart = (
shellCommand [
"${pkgs.kubernetes}/bin/kubelet"
# "--config=${config_file}"
"--config=${./files/kubelet-config.yaml}"
"--kubeconfig=/.persist/keys/kube/kubeconfig"
"--kubeconfig=/.persist/keys/kube/kubelet.kubeconfig"
"--v=2"
]
);