Initial deployment of Kubernetes control plane
This commit is contained in:
parent
12b327ca88
commit
9bd1f0cfa1
|
@ -15,6 +15,12 @@
|
|||
"/var/lib/acme"
|
||||
|
||||
"/srv"
|
||||
|
||||
# k8s
|
||||
"/var/lib/containerd"
|
||||
"/var/lib/kubernetes"
|
||||
"/var/lib/kubelet"
|
||||
"/var/lib/kube-proxy"
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
./gitea.nix
|
||||
./synapse.nix
|
||||
./nebula.nix
|
||||
./k8s.nix
|
||||
];
|
||||
|
||||
security.acme = {
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{pkgs, ...}: let
|
||||
kMasterIp = "10.13.0.1";
|
||||
kMasterHostname = "silver";
|
||||
kMasterApiServerPort = 6443;
|
||||
in {
|
||||
networking.extraHosts = "${kMasterIp} ${kMasterHostname}";
|
||||
|
||||
systemd.services.etcd.preStart = ''${pkgs.writeShellScript "etcd-wait" ''
|
||||
while [ ! -f /var/lib/kubernetes/secrets/etcd.pem ]; do sleep 1; done
|
||||
''}'';
|
||||
|
||||
services.kubernetes = {
|
||||
roles = ["master" "node"];
|
||||
masterAddress = kMasterHostname;
|
||||
apiserverAddress = "https://${kMasterHostname}:${toString kMasterApiServerPort}";
|
||||
|
||||
apiserver = {
|
||||
securePort = kMasterApiServerPort;
|
||||
advertiseAddress = kMasterIp;
|
||||
};
|
||||
|
||||
easyCerts = true;
|
||||
|
||||
# use coredns
|
||||
addons.dns.enable = true;
|
||||
|
||||
# needed if you use swap
|
||||
kubelet.extraOpts = "--fail-swap-on=false";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue