mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 01:38:28 +02:00
feat: add a test k3s cluster running on kubevirt
This commit is contained in:
44
outputs/x86_64-linux/src/k3s-test-1-master-1.nix
Normal file
44
outputs/x86_64-linux/src/k3s-test-1-master-1.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
# NOTE: the args not used in this file CAN NOT be removed!
|
||||
# because haumea pass argument lazily,
|
||||
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||
inputs,
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
} @ args: let
|
||||
name = "k3s-test-1-master-1";
|
||||
tags = [name];
|
||||
ssh-user = "root";
|
||||
|
||||
modules = {
|
||||
nixos-modules =
|
||||
(map mylib.relativeToRoot [
|
||||
# common
|
||||
"secrets/nixos.nix"
|
||||
"modules/nixos/server/server.nix"
|
||||
"modules/nixos/server/kubevirt-hardware-configuration.nix"
|
||||
# host specific
|
||||
"hosts/k8s/${name}"
|
||||
])
|
||||
++ [
|
||||
{modules.secrets.server.kubernetes.enable = true;}
|
||||
];
|
||||
home-modules = map mylib.relativeToRoot [
|
||||
"home/linux/core.nix"
|
||||
];
|
||||
};
|
||||
|
||||
systemArgs = modules // args;
|
||||
in {
|
||||
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
|
||||
|
||||
colmena.${name} =
|
||||
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
|
||||
|
||||
# generate proxmox image for virtual machines without desktop environment
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
}
|
||||
41
outputs/x86_64-linux/src/k3s-test-1-master-2.nix
Normal file
41
outputs/x86_64-linux/src/k3s-test-1-master-2.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
# NOTE: the args not used in this file CAN NOT be removed!
|
||||
# because haumea pass argument lazily,
|
||||
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||
inputs,
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
} @ args: let
|
||||
name = "k3s-test-1-master-2";
|
||||
tags = [name];
|
||||
ssh-user = "root";
|
||||
|
||||
modules = {
|
||||
nixos-modules =
|
||||
(map mylib.relativeToRoot [
|
||||
# common
|
||||
"secrets/nixos.nix"
|
||||
"modules/nixos/server/server.nix"
|
||||
"modules/nixos/server/kubevirt-hardware-configuration.nix"
|
||||
# host specific
|
||||
"hosts/k8s/${name}"
|
||||
])
|
||||
++ [
|
||||
{modules.secrets.server.kubernetes.enable = true;}
|
||||
];
|
||||
};
|
||||
|
||||
systemArgs = modules // args;
|
||||
in {
|
||||
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
|
||||
|
||||
colmena.${name} =
|
||||
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
|
||||
|
||||
# generate proxmox image for virtual machines without desktop environment
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
}
|
||||
41
outputs/x86_64-linux/src/k3s-test-1-master-3.nix
Normal file
41
outputs/x86_64-linux/src/k3s-test-1-master-3.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
# NOTE: the args not used in this file CAN NOT be removed!
|
||||
# because haumea pass argument lazily,
|
||||
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||
inputs,
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
} @ args: let
|
||||
name = "k3s-test-1-master-3";
|
||||
tags = [name];
|
||||
ssh-user = "root";
|
||||
|
||||
modules = {
|
||||
nixos-modules =
|
||||
(map mylib.relativeToRoot [
|
||||
# common
|
||||
"secrets/nixos.nix"
|
||||
"modules/nixos/server/server.nix"
|
||||
"modules/nixos/server/kubevirt-hardware-configuration.nix"
|
||||
# host specific
|
||||
"hosts/k8s/${name}"
|
||||
])
|
||||
++ [
|
||||
{modules.secrets.server.kubernetes.enable = true;}
|
||||
];
|
||||
};
|
||||
|
||||
systemArgs = modules // args;
|
||||
in {
|
||||
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
|
||||
|
||||
colmena.${name} =
|
||||
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
|
||||
|
||||
# generate proxmox image for virtual machines without desktop environment
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
}
|
||||
Reference in New Issue
Block a user