Expand Nebula

* Add Nebula to Kubernetes node
* Update k3s nodes to support nebula keepalived
* Move external IPs to a separate structure
This commit is contained in:
Greg Hellings
2026-07-25 15:18:15 -05:00
parent 0d1d846884
commit 475fe50d19
10 changed files with 173 additions and 141 deletions
+42 -14
View File
@@ -15,6 +15,8 @@ let
sha256 = "sha256-Qs1qJmgZm8q9xZsORjT/N/wzpbWVVODXtzDpjnAYMuQ=";
};
keepaliveIp = "10.42.5.1";
nebulaName = "k3s.nebula.thehellings.com";
nebulaIp = "10.157.100.1";
in
{
options.greg = {
@@ -44,6 +46,13 @@ in
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = config.greg.nebula.enable;
message = "Configure Nebula for this host, first";
}
];
age.secrets = {
bw_secret.file = ../../secrets/kubernetes/bw_secret.age;
dendrite_key.file = ../../secrets/dendrite_key.age;
@@ -97,6 +106,8 @@ in
"--tls-san ${config.networking.hostName}.thehellings.lan"
"--tls-san ${config.networking.hostName}.shire-zebra.ts.net"
"--tls-san ${keepaliveIp}"
"--tls-san ${nebulaName}"
"--tls-san ${nebulaIp}"
];
manifests = {
cert-manager.source = cert-manager;
@@ -112,20 +123,37 @@ in
keepalived = {
enable = true;
openFirewall = true;
vrrpInstances.kubernetes = {
interface = cfg.vipInterface;
priority = cfg.priority;
state = if (config.networking.hostName == "isaiah") then "MASTER" else "BACKUP";
virtualIps = [
{
addr = "${keepaliveIp}/16";
dev = cfg.vipInterface;
}
];
virtualRouterId = 77;
extraConfig = ''
advert_int 1
'';
vrrpInstances = {
kubernetes = {
interface = cfg.vipInterface;
priority = cfg.priority;
state = if (config.networking.hostName == "isaiah") then "MASTER" else "BACKUP";
virtualIps = [
{
addr = "${keepaliveIp}/16";
dev = cfg.vipInterface;
}
];
virtualRouterId = 77;
extraConfig = ''
advert_int 1
'';
};
k3s-nebula = {
interface = "nebula0";
priority = 1;
state = if (config.networking.hostName == "isaiah") then "MASTER" else "BACKUP";
virtualIps = [
{
addr = "${nebulaIp}/16";
dev = "nebula0";
}
];
virtualRouterId = 78;
extraConfig = ''
advert_int 1
'';
};
};
};
openiscsi = {