Working k8s module!

This commit is contained in:
Jonas Juselius
2020-10-30 16:14:56 +01:00
parent b89514eae4
commit 45487af168
2 changed files with 19 additions and 10 deletions

View File

@@ -38,7 +38,7 @@ let
in {
k8s = rec {
master = host: self: {
apiserver = host: self: {
deployment.targetHost = host.address;
cluster = cfg // {
@@ -63,12 +63,12 @@ in {
imports = [ host.hw ./k8s.nix ];
};
mkDeployment = masterNode: workerNodes:
mkDeployment = master: nodes:
let
apiserver = { "${master.name}" = apiserver masterNode; };
server = { "${master.name}" = apiserver master; };
in
builtins.foldl' (a: x:
a // { "${x.name}" = mkWorker x; }) apiserver workerNodes;
a // { "${x.name}" = node x; }) server nodes;
};
fs = rec {