From eca29357eb71375fb79da9ccd397b974d4d87499 Mon Sep 17 00:00:00 2001 From: Jonas Juselius Date: Fri, 20 Nov 2020 20:03:44 +0100 Subject: [PATCH] Update k0 and k2 to improved mkDeployment --- clusters/hosts.nix | 13 ++++++------- clusters/k0/default.nix | 21 ++++++++++----------- clusters/k0/k0-0.nix | 4 ++-- clusters/k0/k0-1.nix | 4 ++-- clusters/k0/k0-2.nix | 4 ++-- clusters/k1/default.nix | 2 +- clusters/k2/default.nix | 18 +++++++++--------- 7 files changed, 32 insertions(+), 34 deletions(-) diff --git a/clusters/hosts.nix b/clusters/hosts.nix index 72bde91..d8b9faf 100644 --- a/clusters/hosts.nix +++ b/clusters/hosts.nix @@ -6,16 +6,15 @@ 10.1.8.54 k0-1 k0-1.itpartner.intern 10.1.8.55 k0-2 k0-2.itpartner.intern + 10.1.8.56 k2-0 k2-0.itpartner.intern + 10.1.8.57 k2-1 k2-1.itpartner.intern + 10.1.8.58 k2-2 k2-2.itpartner.intern + 10.1.8.59 k2-3 k2-3.itpartner.intern + 10.1.8.60 k2-4 k2-4.itpartner.intern + 10.253.18.109 k1-0 k1-0.itpartner.intern 10.253.18.110 k1-1 k1-1.itpartner.intern 10.253.18.111 k1-2 k1-2.itpartner.intern 10.253.18.108 k1-3 k1-3.itpartner.intern 10.253.18.107 k0-4 k1-4.itpartner.intern - - 10.253.18.114 k2-0 k2-0.itpartner.intern - 10.253.18.115 k2-1 k2-1.itpartner.intern - 10.253.18.116 k2-2 k2-2.itpartner.intern - 10.253.18.117 k2-3 k2-3.itpartner.intern - 10.253.18.118 k2-4 k2-4.itpartner.intern - 10.253.18.103 k2-5 k2-5.itpartner.intern '' diff --git a/clusters/k0/default.nix b/clusters/k0/default.nix index 49be03d..ff5e93f 100644 --- a/clusters/k0/default.nix +++ b/clusters/k0/default.nix @@ -1,8 +1,9 @@ with import {}; let - setup = import ../../modules/default.nix { inherit pkgs cluster customize lib config; }; + setup = import ../../modules { inherit pkgs cluster customize lib config; }; hosts = [ + { name = "k0-0"; address = "10.1.8.53"; hw = ./k0-0.nix; } { name = "k0-1"; address = "10.1.8.54"; hw = ./k0-1.nix; } { name = "k0-2"; address = "10.1.8.55"; hw = ./k0-2.nix; } ]; @@ -15,6 +16,9 @@ let clusterName = "k0"; initca = ./ca; + domain = "itpartner.intern"; + searchDomains = [ "itpartner.intern" "itpartner.no" ]; + extraHosts = import ../hosts.nix; adminAuthorizedKeys = [ @@ -24,15 +28,10 @@ let k8s = { enable = true; - master = { - name = "k0-0"; - address = "10.1.8.53"; - extraSANs = [ "k0.itpartner.no" ]; - hw = ./k0-0.nix; - }; - nodes = hosts; - cidr = "10.11.0.0/16"; - extraIngressNodes = [ "k0-1" "k0-2" ]; + cidr = "10.100.0.0/16"; + master = builtins.head hosts // { extraSANs = [ "k0.itpartner.no" ]; }; + nodes = builtins.tail hosts; + extraIngressNodes = [ "k0-1.itpartner.intern" "k0-2.itpartner.intern" ]; fileserver = "fs2-0"; charts = { acme_email = "innovasjon@itpartner.no"; @@ -42,4 +41,4 @@ let }; }; in - setup.k8s.mkDeployment cluster.k8s.master hosts + setup.k8s.mkDeployment diff --git a/clusters/k0/k0-0.nix b/clusters/k0/k0-0.nix index 0f7eaa0..2e322b6 100644 --- a/clusters/k0/k0-0.nix +++ b/clusters/k0/k0-0.nix @@ -12,12 +12,12 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/2306f185-eff6-43a4-b032-4c9f14fb0893"; + { device = "/dev/disk/by-uuid/a6915f49-234d-4ec1-ab1c-87a529b7b36b"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3D9E-1634"; + { device = "/dev/disk/by-uuid/29C6-3721"; fsType = "vfat"; }; diff --git a/clusters/k0/k0-1.nix b/clusters/k0/k0-1.nix index 5300af9..9e9bfb3 100644 --- a/clusters/k0/k0-1.nix +++ b/clusters/k0/k0-1.nix @@ -12,12 +12,12 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/a44f60ee-fe60-4419-8a4d-c1f131e6bfc4"; + { device = "/dev/disk/by-uuid/0f636fe0-cd3c-4c82-b936-bb53a07ded6b"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3EEB-878E"; + { device = "/dev/disk/by-uuid/29AC-47D5"; fsType = "vfat"; }; diff --git a/clusters/k0/k0-2.nix b/clusters/k0/k0-2.nix index 7de1886..4110d2d 100644 --- a/clusters/k0/k0-2.nix +++ b/clusters/k0/k0-2.nix @@ -12,12 +12,12 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/89410434-e9aa-480c-b49e-4ea24dc80fc2"; + { device = "/dev/disk/by-uuid/bf2f7548-1a5d-4b02-a684-f666e3563eaf"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3FDB-4765"; + { device = "/dev/disk/by-uuid/2A74-A44E"; fsType = "vfat"; }; diff --git a/clusters/k1/default.nix b/clusters/k1/default.nix index d9ff4a1..6c22ecc 100644 --- a/clusters/k1/default.nix +++ b/clusters/k1/default.nix @@ -10,7 +10,7 @@ let ]; customize = { - boot.bios = true; + boot.uefi = false; }; cluster = { diff --git a/clusters/k2/default.nix b/clusters/k2/default.nix index e1f49b6..1dd1e84 100644 --- a/clusters/k2/default.nix +++ b/clusters/k2/default.nix @@ -1,8 +1,9 @@ with import {}; let - setup = import ../../modules/default.nix { inherit pkgs cluster customize lib config; }; + setup = import ../../modules { inherit pkgs cluster customize lib config; }; hosts = [ + { name = "k2-0"; address = "10.1.8.56"; hw = ./k2-0.nix; } { name = "k2-1"; address = "10.1.8.57"; hw = ./k2-1.nix; } { name = "k2-2"; address = "10.1.8.58"; hw = ./k2-2.nix; } { name = "k2-3"; address = "10.1.8.59"; hw = ./k2-3.nix; } @@ -17,6 +18,9 @@ let clusterName = "k2"; initca = ./ca; + domain = "itpartner.intern"; + searchDomains = [ "itpartner.intern" "itpartner.no" ]; + extraHosts = import ../hosts.nix; adminAuthorizedKeys = [ @@ -26,14 +30,10 @@ let k8s = { enable = true; - master = { - name = "k2-0"; - address = "10.1.8.56"; - extraSANs = [ "k2.itpartner.no" ]; - hw = ./k2-0.nix; - }; - nodes = hosts; cidr = "10.100.0.0/16"; + master = builtins.head hosts // { extraSANs = [ "k2.itpartner.no" ]; }; + nodes = builtins.tail hosts; + extraIngressNodes = [ "k2-1.itpartner.intern" "k2-2.itpartner.intern" ]; fileserver = "fs2-0"; charts = { acme_email = "innovasjon@itpartner.no"; @@ -43,4 +43,4 @@ let }; }; in - setup.k8s.mkDeployment cluster.k8s.master hosts + setup.k8s.mkDeployment