59 lines
1.5 KiB
Nix
59 lines
1.5 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
# shellCommand = cmd: (lib.concatMapStringsSep " " lib.strings.escapeShellArg cmd);
|
|
shellCommand = cmd: (builtins.concatStringsSep " " cmd);
|
|
in
|
|
{
|
|
imports = [ ];
|
|
|
|
options.me = {
|
|
kubelet.enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
example = true;
|
|
description = "Whether we want to install kubelet.";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.me.kubelet.enable {
|
|
systemd.services.kubelet = {
|
|
enable = true;
|
|
description = "Kubernetes Kubelet";
|
|
documentation = [ "https://github.com/kubernetes/kubernetes" ];
|
|
wantedBy = [ "kubernetes.target" ];
|
|
after = [ "containerd.service" ];
|
|
requires = [ "containerd.service" ];
|
|
# path = with pkgs; [
|
|
# zfs
|
|
# ];
|
|
unitConfig.DefaultDependencies = "no";
|
|
serviceConfig = {
|
|
ExecStart = (
|
|
shellCommand [
|
|
"${pkgs.kubernetes}/bin/kubelet"
|
|
"--config=${./files/kubelet-config.yaml}"
|
|
"--kubeconfig=/.persist/keys/kube/kubelet.kubeconfig"
|
|
"--v=2"
|
|
]
|
|
);
|
|
Restart = "on-failure";
|
|
RestartSec = 5;
|
|
# ConfigurationDirectory = "kubernetes";
|
|
# CPUAccounting = "true";
|
|
# IPAccounting = "true";
|
|
# KillMode = "process";
|
|
# MemoryAccounting = "true";
|
|
# StartLimitInterval = 0;
|
|
# RuntimeDirectory = "kubelet";
|
|
# StateDirectory = "kubelet";
|
|
};
|
|
};
|
|
};
|
|
}
|