Factor vm-cluster cluster state and export deployer artifacts
This commit is contained in:
parent
ed0f9f42f4
commit
203f21ff29
6 changed files with 110 additions and 288 deletions
|
|
@ -400,6 +400,9 @@
|
||||||
description = "Label-aware service scheduler for PhotonCloud bare-metal fleets";
|
description = "Label-aware service scheduler for PhotonCloud bare-metal fleets";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vmClusterDeployerState =
|
||||||
|
self.nixosConfigurations.node01.config.system.build.plasmacloudDeployerClusterState;
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Default package: Build all servers
|
# Default package: Build all servers
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
@ -423,6 +426,7 @@
|
||||||
self.packages.${system}.deployer-ctl
|
self.packages.${system}.deployer-ctl
|
||||||
self.packages.${system}.node-agent
|
self.packages.${system}.node-agent
|
||||||
self.packages.${system}.fleet-scheduler
|
self.packages.${system}.fleet-scheduler
|
||||||
|
self.packages.${system}.vmClusterDeployerState
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
101
nix/nodes/vm-cluster/cluster.nix
Normal file
101
nix/nodes/vm-cluster/cluster.nix
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../cluster.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -35,102 +36,6 @@
|
||||||
flaredbAddr = "192.168.100.11:2479";
|
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;
|
services.openssh.enable = true;
|
||||||
users.users.root.openssh.authorizedKeys.keys = [ ];
|
users.users.root.openssh.authorizedKeys.keys = [ ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../cluster.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -45,102 +46,6 @@
|
||||||
flaredbAddr = "192.168.100.11:2479";
|
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;
|
services.openssh.enable = true;
|
||||||
users.users.root.openssh.authorizedKeys.keys = [ ];
|
users.users.root.openssh.authorizedKeys.keys = [ ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../cluster.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -45,102 +46,6 @@
|
||||||
flaredbAddr = "192.168.100.11:2479";
|
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;
|
services.openssh.enable = true;
|
||||||
users.users.root.openssh.authorizedKeys.keys = [ ];
|
users.users.root.openssh.authorizedKeys.keys = [ ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@
|
||||||
cluster = clusterHarness;
|
cluster = clusterHarness;
|
||||||
vmGuestImage = vmGuestImage;
|
vmGuestImage = vmGuestImage;
|
||||||
vmBenchGuestImage = vmBenchGuestImage;
|
vmBenchGuestImage = vmBenchGuestImage;
|
||||||
|
deployerClusterState =
|
||||||
|
self.nixosConfigurations.node06.config.system.build.plasmacloudDeployerClusterState;
|
||||||
};
|
};
|
||||||
|
|
||||||
apps.${system}.cluster = {
|
apps.${system}.cluster = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue