Format repo
This commit is contained in:
parent
3169149045
commit
8160b9da0b
37 changed files with 643 additions and 392 deletions
modules
|
@ -1,6 +1,9 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
longhornVolumeOpts = { name, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
longhornVolumeOpts = {name, ...}: {
|
||||
options = {
|
||||
storage = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
@ -13,7 +16,7 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
longhornPVOpts = { name, ... }: {
|
||||
longhornPVOpts = {name, ...}: {
|
||||
options = {
|
||||
storage = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
@ -21,7 +24,7 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
longhornPVCOpts = { name, ... }: {
|
||||
longhornPVCOpts = {name, ...}: {
|
||||
options = {
|
||||
volumeName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
@ -34,34 +37,34 @@ let
|
|||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
lab.longhornVolumes = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule longhornVolumeOpts);
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
|
||||
lab.longhorn = {
|
||||
persistentVolume = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule longhornPVOpts);
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
|
||||
persistentVolumeClaim = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule longhornPVCOpts);
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
kubernetes.resources = {
|
||||
persistentVolumes = lib.mergeAttrs
|
||||
persistentVolumes =
|
||||
lib.mergeAttrs
|
||||
(builtins.mapAttrs
|
||||
(name: longhornVolume: {
|
||||
spec = {
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
capacity.storage = longhornVolume.storage;
|
||||
persistentVolumeReclaimPolicy = "Delete";
|
||||
volumeMode = "Filesystem";
|
||||
|
@ -84,10 +87,12 @@ in
|
|||
staleReplicaTimeout = "30";
|
||||
unmapMarkSnapChainRemoved = "ignored";
|
||||
|
||||
recurringJobSelector = lib.generators.toYAML { } [{
|
||||
name = "backup-nfs";
|
||||
isGroup = false;
|
||||
}];
|
||||
recurringJobSelector = lib.generators.toYAML {} [
|
||||
{
|
||||
name = "backup-nfs";
|
||||
isGroup = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -96,7 +101,7 @@ in
|
|||
(builtins.mapAttrs
|
||||
(name: longhornPV: {
|
||||
spec = {
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
capacity.storage = longhornPV.storage;
|
||||
persistentVolumeReclaimPolicy = "Delete";
|
||||
volumeMode = "Filesystem";
|
||||
|
@ -114,21 +119,24 @@ in
|
|||
staleReplicaTimeout = "30";
|
||||
unmapMarkSnapChainRemoved = "ignored";
|
||||
|
||||
recurringJobSelector = lib.generators.toYAML { } [{
|
||||
name = "backup-nfs";
|
||||
isGroup = false;
|
||||
}];
|
||||
recurringJobSelector = lib.generators.toYAML {} [
|
||||
{
|
||||
name = "backup-nfs";
|
||||
isGroup = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
config.lab.longhorn.persistentVolume);
|
||||
|
||||
persistentVolumeClaims = lib.mergeAttrs
|
||||
persistentVolumeClaims =
|
||||
lib.mergeAttrs
|
||||
(builtins.mapAttrs
|
||||
(name: longhornVolume: {
|
||||
spec = {
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = longhornVolume.storage;
|
||||
storageClassName = "";
|
||||
};
|
||||
|
@ -137,7 +145,7 @@ in
|
|||
(builtins.mapAttrs
|
||||
(name: longhornPVC: {
|
||||
spec = {
|
||||
accessModes = [ "ReadWriteOnce" ];
|
||||
accessModes = ["ReadWriteOnce"];
|
||||
resources.requests.storage = longhornPVC.storage;
|
||||
storageClassName = "";
|
||||
volumeName = longhornPVC.volumeName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue