148 lines
3.6 KiB
Nix
148 lines
3.6 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./disko.nix
|
|
];
|
|
|
|
networking.hostName = "node03";
|
|
networking.useDHCP = lib.mkDefault true;
|
|
boot.loader.grub = {
|
|
enable = true;
|
|
devices = [ "/dev/vda" ];
|
|
efiSupport = true;
|
|
efiInstallAsRemovable = true;
|
|
};
|
|
|
|
services.chainfire = {
|
|
enable = true;
|
|
nodeId = "node03";
|
|
apiAddr = "192.168.100.13:2379";
|
|
raftAddr = "192.168.100.13:2380";
|
|
initialPeers = [
|
|
"node01=192.168.100.11:2380"
|
|
"node02=192.168.100.12:2380"
|
|
"node03=192.168.100.13:2380"
|
|
];
|
|
};
|
|
|
|
services.flaredb = {
|
|
enable = true;
|
|
nodeId = "node03";
|
|
apiAddr = "192.168.100.13:2479";
|
|
raftAddr = "192.168.100.13:2480";
|
|
initialPeers = [
|
|
"node01=192.168.100.11:2480"
|
|
"node02=192.168.100.12:2480"
|
|
"node03=192.168.100.13:2480"
|
|
];
|
|
};
|
|
|
|
services.iam = {
|
|
enable = true;
|
|
port = 50080;
|
|
chainfireAddr = "192.168.100.11:2379";
|
|
flaredbAddr = "192.168.100.11:2479";
|
|
};
|
|
|
|
plasmacloud.cluster = {
|
|
enable = true;
|
|
name = "plasmacloud-vm-cluster";
|
|
|
|
nodes = {
|
|
node01 = {
|
|
role = "control-plane";
|
|
ip = "192.168.100.11";
|
|
services = [ "chainfire" "flaredb" "iam" ];
|
|
labels = {
|
|
tier = "control-plane";
|
|
platform = "vm-cluster";
|
|
};
|
|
pool = "control";
|
|
nodeClass = "control-plane";
|
|
failureDomain = "rack-a";
|
|
nixProfile = "profiles/control-plane";
|
|
installPlan = {
|
|
nixosConfiguration = "node01";
|
|
diskoConfigPath = "nix/nodes/vm-cluster/node01/disko.nix";
|
|
};
|
|
raftPort = 2380;
|
|
apiPort = 2379;
|
|
};
|
|
node02 = {
|
|
role = "control-plane";
|
|
ip = "192.168.100.12";
|
|
services = [ "chainfire" "flaredb" "iam" ];
|
|
labels = {
|
|
tier = "control-plane";
|
|
platform = "vm-cluster";
|
|
};
|
|
pool = "control";
|
|
nodeClass = "control-plane";
|
|
failureDomain = "rack-b";
|
|
nixProfile = "profiles/control-plane";
|
|
installPlan = {
|
|
nixosConfiguration = "node02";
|
|
diskoConfigPath = "nix/nodes/vm-cluster/node02/disko.nix";
|
|
};
|
|
raftPort = 2380;
|
|
apiPort = 2379;
|
|
};
|
|
node03 = {
|
|
role = "control-plane";
|
|
ip = "192.168.100.13";
|
|
services = [ "chainfire" "flaredb" "iam" ];
|
|
labels = {
|
|
tier = "control-plane";
|
|
platform = "vm-cluster";
|
|
};
|
|
pool = "control";
|
|
nodeClass = "control-plane";
|
|
failureDomain = "rack-c";
|
|
nixProfile = "profiles/control-plane";
|
|
installPlan = {
|
|
nixosConfiguration = "node03";
|
|
diskoConfigPath = "nix/nodes/vm-cluster/node03/disko.nix";
|
|
};
|
|
raftPort = 2380;
|
|
apiPort = 2379;
|
|
};
|
|
};
|
|
|
|
deployer = {
|
|
clusterId = "plasmacloud-vm-cluster";
|
|
environment = "dev";
|
|
|
|
nodeClasses = {
|
|
control-plane = {
|
|
description = "Control-plane VM cluster nodes";
|
|
nixProfile = "profiles/control-plane";
|
|
roles = [ "control-plane" ];
|
|
labels = {
|
|
tier = "control-plane";
|
|
platform = "vm-cluster";
|
|
};
|
|
};
|
|
};
|
|
|
|
pools = {
|
|
control = {
|
|
description = "VM cluster control-plane pool";
|
|
nodeClass = "control-plane";
|
|
labels = {
|
|
plane = "control";
|
|
cluster = "vm-cluster";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
bootstrap.initialPeers = [ "node01" "node02" "node03" ];
|
|
bgp.asn = 64512;
|
|
};
|
|
|
|
services.openssh.enable = true;
|
|
users.users.root.openssh.authorizedKeys.keys = [ ];
|
|
|
|
system.stateVersion = "24.05";
|
|
}
|