Refactor modules/features a bit
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.features.k8s.host;
|
||||
cfg = config.features.host;
|
||||
|
||||
mkSANs = host: [
|
||||
host.name
|
||||
@@ -71,6 +71,17 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/vol/local-storage/vol1" = {
|
||||
device = "/vol/vol1";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/vol/local-storage/vol2" = {
|
||||
device = "/vol/vol2";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = cfg.name;
|
||||
domain = "itpartner.intern";
|
||||
|
||||
@@ -13,19 +13,16 @@ let
|
||||
};
|
||||
|
||||
master = {
|
||||
features.host = {
|
||||
name = "k2-0";
|
||||
address = "10.1.8.60";
|
||||
};
|
||||
features.k8s = {
|
||||
host.name = "k2-0";
|
||||
host.address = "10.1.8.60";
|
||||
master.enable = true;
|
||||
master.socat443 = true;
|
||||
nodes = nodes;
|
||||
inherit etcdCluster;
|
||||
};
|
||||
fileSystems = {
|
||||
"/vol/local-storage/vol1" = {
|
||||
device = "/vol/vol1";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
};
|
||||
imports = [ ./cluster.nix ./hw/k2-0.nix ];
|
||||
};
|
||||
|
||||
@@ -42,7 +39,7 @@ let
|
||||
"${x.name}" =
|
||||
lib.mkMerge [
|
||||
{
|
||||
features.k8s.host = x;
|
||||
features.host = x;
|
||||
}
|
||||
(if builtins.hasAttr x.name etcdNodes then
|
||||
{
|
||||
@@ -63,5 +60,5 @@ let
|
||||
};
|
||||
in
|
||||
builtins.foldl' (a: x: a // mkNode x) {
|
||||
"${master.features.k8s.host.name}" = master;
|
||||
"${master.features.host.name}" = master;
|
||||
} nodes
|
||||
|
||||
Reference in New Issue
Block a user