feat(machines/hypervisor0*): init
All checks were successful
Check meta / check_dns (pull_request) Successful in 18s
Check meta / check_meta (pull_request) Successful in 17s
Run pre-commit on all files / pre-commit (push) Successful in 38s
Check workflows / check_workflows (pull_request) Successful in 22s
Build all the nodes / ap01 (pull_request) Successful in 1m2s
Build all the nodes / geo01 (pull_request) Successful in 1m59s
Build all the nodes / bridge01 (pull_request) Successful in 2m4s
Build all the nodes / geo02 (pull_request) Successful in 2m1s
Build all the nodes / netcore02 (pull_request) Successful in 44s
Build all the nodes / compute01 (pull_request) Successful in 2m50s
Build all the nodes / rescue01 (pull_request) Successful in 3m11s
Build all the nodes / storage01 (pull_request) Successful in 3m12s
Build all the nodes / hypervisor02 (pull_request) Successful in 4m49s
Build all the nodes / hypervisor03 (pull_request) Successful in 4m48s
Build all the nodes / hypervisor01 (pull_request) Successful in 6m9s
Run pre-commit on all files / pre-commit (pull_request) Successful in 43s
Build all the nodes / vault01 (pull_request) Successful in 1m49s
Build all the nodes / web01 (pull_request) Successful in 2m9s
Build all the nodes / web02 (pull_request) Successful in 1m38s
Build all the nodes / web03 (pull_request) Successful in 1m44s
All checks were successful
Check meta / check_dns (pull_request) Successful in 18s
Check meta / check_meta (pull_request) Successful in 17s
Run pre-commit on all files / pre-commit (push) Successful in 38s
Check workflows / check_workflows (pull_request) Successful in 22s
Build all the nodes / ap01 (pull_request) Successful in 1m2s
Build all the nodes / geo01 (pull_request) Successful in 1m59s
Build all the nodes / bridge01 (pull_request) Successful in 2m4s
Build all the nodes / geo02 (pull_request) Successful in 2m1s
Build all the nodes / netcore02 (pull_request) Successful in 44s
Build all the nodes / compute01 (pull_request) Successful in 2m50s
Build all the nodes / rescue01 (pull_request) Successful in 3m11s
Build all the nodes / storage01 (pull_request) Successful in 3m12s
Build all the nodes / hypervisor02 (pull_request) Successful in 4m49s
Build all the nodes / hypervisor03 (pull_request) Successful in 4m48s
Build all the nodes / hypervisor01 (pull_request) Successful in 6m9s
Run pre-commit on all files / pre-commit (pull_request) Successful in 43s
Build all the nodes / vault01 (pull_request) Successful in 1m49s
Build all the nodes / web01 (pull_request) Successful in 2m9s
Build all the nodes / web02 (pull_request) Successful in 1m38s
Build all the nodes / web03 (pull_request) Successful in 1m44s
It contains a CephFS module which contains only monitor HA and the Incus enablement. We are not using yet the Preseed to reproduce this on another set of machines automatically. Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
This commit is contained in:
parent
3085d9e3a8
commit
24360f4395
7 changed files with 152 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,3 +9,5 @@ result-*
|
||||||
*.qcow2
|
*.qcow2
|
||||||
.gcroots
|
.gcroots
|
||||||
.pre-commit-config.yaml
|
.pre-commit-config.yaml
|
||||||
|
|
||||||
|
preseed*yml
|
||||||
|
|
|
@ -2,15 +2,27 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: EUPL-1.2
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
{ lib, ... }:
|
{ meta, lib, ... }:
|
||||||
|
|
||||||
lib.extra.mkConfig {
|
lib.extra.mkConfig {
|
||||||
enabledModules = [ ];
|
enabledModules = [
|
||||||
|
"dgn-hypervisor"
|
||||||
|
"dgn-cephfs"
|
||||||
|
];
|
||||||
|
|
||||||
enabledServices = [ ];
|
enabledServices = [ ];
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
services.netbird.enable = true;
|
services.netbird.enable = true;
|
||||||
|
dgn-cephfs = {
|
||||||
|
# Unique per cluster.
|
||||||
|
fsid = "d189c08e-300b-4ad9-8c95-b50fd0976758";
|
||||||
|
initialMembers = lib.genAttrs [
|
||||||
|
"hypervisor01"
|
||||||
|
"hypervisor02"
|
||||||
|
"hypervisor03"
|
||||||
|
] (name: builtins.head meta.network.${name}.addresses.ipv4);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
root = ./.;
|
root = ./.;
|
||||||
|
|
|
@ -2,15 +2,27 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: EUPL-1.2
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
{ lib, ... }:
|
{ meta, lib, ... }:
|
||||||
|
|
||||||
lib.extra.mkConfig {
|
lib.extra.mkConfig {
|
||||||
enabledModules = [ ];
|
enabledModules = [
|
||||||
|
"dgn-hypervisor"
|
||||||
|
"dgn-cephfs"
|
||||||
|
];
|
||||||
|
|
||||||
enabledServices = [ ];
|
enabledServices = [ ];
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
services.netbird.enable = true;
|
services.netbird.enable = true;
|
||||||
|
dgn-cephfs = {
|
||||||
|
# Unique per cluster.
|
||||||
|
fsid = "d189c08e-300b-4ad9-8c95-b50fd0976758";
|
||||||
|
initialMembers = lib.genAttrs [
|
||||||
|
"hypervisor01"
|
||||||
|
"hypervisor02"
|
||||||
|
"hypervisor03"
|
||||||
|
] (name: builtins.head meta.network.${name}.addresses.ipv4);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
root = ./.;
|
root = ./.;
|
||||||
|
|
|
@ -2,15 +2,27 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: EUPL-1.2
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
{ lib, ... }:
|
{ meta, lib, ... }:
|
||||||
|
|
||||||
lib.extra.mkConfig {
|
lib.extra.mkConfig {
|
||||||
enabledModules = [ ];
|
enabledModules = [
|
||||||
|
"dgn-hypervisor"
|
||||||
|
"dgn-cephfs"
|
||||||
|
];
|
||||||
|
|
||||||
enabledServices = [ ];
|
enabledServices = [ ];
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
services.netbird.enable = true;
|
services.netbird.enable = true;
|
||||||
|
dgn-cephfs = {
|
||||||
|
# Unique per cluster.
|
||||||
|
fsid = "d189c08e-300b-4ad9-8c95-b50fd0976758";
|
||||||
|
initialMembers = lib.genAttrs [
|
||||||
|
"hypervisor01"
|
||||||
|
"hypervisor02"
|
||||||
|
"hypervisor03"
|
||||||
|
] (name: builtins.head meta.network.${name}.addresses.ipv4);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
root = ./.;
|
root = ./.;
|
||||||
|
|
|
@ -18,10 +18,12 @@
|
||||||
"dgn-access-control"
|
"dgn-access-control"
|
||||||
"dgn-acme"
|
"dgn-acme"
|
||||||
"dgn-backups"
|
"dgn-backups"
|
||||||
"dgn-console"
|
"dgn-cephfs"
|
||||||
"dgn-chatops"
|
"dgn-chatops"
|
||||||
|
"dgn-console"
|
||||||
"dgn-firewall"
|
"dgn-firewall"
|
||||||
"dgn-hardware"
|
"dgn-hardware"
|
||||||
|
"dgn-hypervisor"
|
||||||
"dgn-netbox-agent"
|
"dgn-netbox-agent"
|
||||||
"dgn-network"
|
"dgn-network"
|
||||||
"dgn-node-monitoring"
|
"dgn-node-monitoring"
|
||||||
|
|
84
modules/nixos/dgn-cephfs.nix
Normal file
84
modules/nixos/dgn-cephfs.nix
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan@dgnum.eu>
|
||||||
|
# SPDX-FileContributor: Elias Coppens <elias@dgnum.eu>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
|
{
|
||||||
|
meta,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
types
|
||||||
|
mkOption
|
||||||
|
concatStringsSep
|
||||||
|
;
|
||||||
|
cfg = config.dgn-cephfs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dgn-cephfs = {
|
||||||
|
enable = mkEnableOption "the CephFS module for our hypervisors";
|
||||||
|
fsid = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
initialMembers = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
"hypervisor01" = "10.0.0.254";
|
||||||
|
"hypervisor02" = "10.0.0.253";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
6789
|
||||||
|
3300
|
||||||
|
];
|
||||||
|
networking.firewall.allowedTCPPortRanges = [
|
||||||
|
{
|
||||||
|
from = 6800;
|
||||||
|
to = 7300;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.ceph
|
||||||
|
pkgs.gdb
|
||||||
|
];
|
||||||
|
environment.enableDebugInfo = true;
|
||||||
|
services.ceph = {
|
||||||
|
enable = true;
|
||||||
|
global = {
|
||||||
|
inherit (cfg) fsid;
|
||||||
|
monInitialMembers = concatStringsSep ", " (builtins.attrNames cfg.initialMembers);
|
||||||
|
monHost = concatStringsSep ", " (builtins.attrValues cfg.initialMembers);
|
||||||
|
# TODO: change it
|
||||||
|
clusterName = "ceph";
|
||||||
|
clusterNetwork = "10.0.254.0/24";
|
||||||
|
publicNetwork = "10.0.254.0/24";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig.public_addr = builtins.head meta.network.${config.networking.hostName}.addresses.ipv4;
|
||||||
|
osd = {
|
||||||
|
enable = true;
|
||||||
|
daemons = [ config.networking.hostName ];
|
||||||
|
};
|
||||||
|
|
||||||
|
mon = {
|
||||||
|
enable = true;
|
||||||
|
daemons = [ config.networking.hostName ];
|
||||||
|
};
|
||||||
|
|
||||||
|
mgr = {
|
||||||
|
enable = true;
|
||||||
|
daemons = [ config.networking.hostName ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/nixos/dgn-hypervisor.nix
Normal file
21
modules/nixos/dgn-hypervisor.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan@dgnum.eu>
|
||||||
|
# SPDX-FileContributor: Elias Coppens <elias@dgnum.eu>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.dgn-hypervisor;
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dgn-hypervisor.enable = mkEnableOption "the Incus hypervisor";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [ 8443 ];
|
||||||
|
virtualisation.incus = {
|
||||||
|
enable = true;
|
||||||
|
ui.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue