Skip to content

Commit cb74137

Browse files
committed
feat: longhorn & iscsi
1 parent d94f482 commit cb74137

File tree

7 files changed

+48
-0
lines changed

7 files changed

+48
-0
lines changed

hosts/k8s/k3s-prod-1-master-1/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/k3s-prod-1-master-2/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/k3s-prod-1-master-3/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/k3s-prod-1-worker-1/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/k3s-prod-1-worker-2/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/k3s-prod-1-worker-3/default.nix

+7
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ in {
1515
(mylib.scanPaths ./.)
1616
++ [
1717
coreModule
18+
{
19+
# Longhorn uses open-iscsi to create block devices.
20+
services.openiscsi = {
21+
name = "iqn.2020-08.org.linux-iscsi.initiatorhost:${hostName}";
22+
enable = true;
23+
};
24+
}
1825
];
1926
}

hosts/k8s/lib.nix

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
};
4848
};
4949

50+
# Workaround for longhorn running on NixOS
51+
# https://github.com/longhorn/longhorn/issues/2166
52+
systemd.tmpfiles.rules = [
53+
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
54+
];
55+
5056
networking = {
5157
inherit hostName;
5258
inherit (networking) defaultGateway nameservers;

0 commit comments

Comments
 (0)