Move the kubelet yaml config into nix.
This commit is contained in:
parent
29608e3376
commit
c62071f80e
@ -267,7 +267,15 @@ makeScope newScope (
|
||||
helm_namespace = "kube-system";
|
||||
helm_path = "charts/coredns";
|
||||
helm_manifest_name = "coredns.yaml";
|
||||
helm_values = { };
|
||||
helm_values = {
|
||||
"service" = {
|
||||
"clusterIP" = "fd00:3e42:e349::10";
|
||||
"clusterIPs" = [
|
||||
"fd00:3e42:e349::10"
|
||||
"10.197.0.10"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
));
|
||||
all_keys = (callPackage ./package/k8s-keys/package.nix additional_vars);
|
||||
|
||||
@ -8,6 +8,48 @@
|
||||
let
|
||||
# shellCommand = cmd: (lib.concatMapStringsSep " " lib.strings.escapeShellArg cmd);
|
||||
shellCommand = cmd: (builtins.concatStringsSep " " cmd);
|
||||
to_yaml_file = ((import ../../../functions/to_yaml.nix) { inherit pkgs; }).to_yaml_file;
|
||||
|
||||
kubelet_config = {
|
||||
kind = "KubeletConfiguration";
|
||||
apiVersion = "kubelet.config.k8s.io/v1beta1";
|
||||
address = "0.0.0.0";
|
||||
authentication = {
|
||||
anonymous = {
|
||||
enabled = false;
|
||||
};
|
||||
webhook = {
|
||||
enabled = true;
|
||||
};
|
||||
x509 = {
|
||||
clientCAFile = "/.persist/keys/kube/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 = "/run/systemd/resolve/resolv.conf";
|
||||
resolvConf = "${./files/resolv.conf}";
|
||||
registerNode = true;
|
||||
runtimeRequestTimeout = "15m";
|
||||
tlsCertFile = "/.persist/keys/kube/kubelet.crt";
|
||||
tlsPrivateKeyFile = "/.persist/keys/kube/kubelet.key";
|
||||
# clusterDomain = "cluster.local";
|
||||
# clusterDNS = [
|
||||
# "10.197.0.10"
|
||||
# "fd00:3e42:e349::10"
|
||||
# ];
|
||||
};
|
||||
kubelet_config_file = (to_yaml_file "kubelet-config.yaml" kubelet_config);
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
@ -37,7 +79,7 @@ in
|
||||
ExecStart = (
|
||||
shellCommand [
|
||||
"${pkgs.kubernetes}/bin/kubelet"
|
||||
"--config=${./files/kubelet-config.yaml}"
|
||||
"--config=${kubelet_config_file}"
|
||||
"--kubeconfig=/.persist/keys/kube/kubelet.kubeconfig"
|
||||
"--v=2"
|
||||
]
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
kind: KubeletConfiguration
|
||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||
address: "0.0.0.0"
|
||||
authentication:
|
||||
anonymous:
|
||||
enabled: false
|
||||
webhook:
|
||||
enabled: true
|
||||
x509:
|
||||
clientCAFile: "/.persist/keys/kube/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: "/run/systemd/resolve/resolv.conf"
|
||||
registerNode: true
|
||||
runtimeRequestTimeout: "15m"
|
||||
tlsCertFile: "/.persist/keys/kube/kubelet.crt"
|
||||
tlsPrivateKeyFile: "/.persist/keys/kube/kubelet.key"
|
||||
clusterDomain: "cluster.local"
|
||||
clusterDNS:
|
||||
- "10.197.0.10"
|
||||
- "fd00:3e42:e349::10"
|
||||
1
nix/kubernetes/roles/kubelet/files/resolv.conf
Normal file
1
nix/kubernetes/roles/kubelet/files/resolv.conf
Normal file
@ -0,0 +1 @@
|
||||
nameserver 127.0.0.53
|
||||
Loading…
x
Reference in New Issue
Block a user