mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2025-12-12 01:50:05 +01:00
fix(attic): add PVC if externalStorage is disabled
This commit is contained in:
parent
203c487a0b
commit
7d0c2c6d11
4 changed files with 32 additions and 1 deletions
|
|
@ -3,5 +3,6 @@
|
||||||
./deployment.nix
|
./deployment.nix
|
||||||
./configMap.nix
|
./configMap.nix
|
||||||
./service.nix
|
./service.nix
|
||||||
|
./persistentVolumeClaim.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{values, ...}: {
|
{
|
||||||
|
values,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
kubernetes.resources = {
|
kubernetes.resources = {
|
||||||
deployments."${values.uniqueName}" = {
|
deployments."${values.uniqueName}" = {
|
||||||
spec = {
|
spec = {
|
||||||
|
|
@ -21,6 +25,10 @@
|
||||||
mountPath = "/etc/attic";
|
mountPath = "/etc/attic";
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
|
"data" = lib.mkIf (!values.externalStorage) {
|
||||||
|
name = "data";
|
||||||
|
mountPath = "/data";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
volumes = {
|
volumes = {
|
||||||
|
|
@ -33,6 +41,7 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
"data".persistentVolumeClaim.claimName = lib.mkIf (!values.externalStorage) "${values.uniqueName}-data";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
12
nixlets/attic/persistentVolumeClaim.nix
Normal file
12
nixlets/attic/persistentVolumeClaim.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
values,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
kubernetes.resources = {
|
||||||
|
persistentVolumeClaims."${values.uniqueName}-data".spec = lib.mkIf (!values.externalStorage) {
|
||||||
|
accessModes = ["ReadWriteOnce"];
|
||||||
|
resources.requests.storage = values.storage;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -35,6 +35,15 @@ with lib; {
|
||||||
default = "ClusterIP";
|
default = "ClusterIP";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
storage = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "5G";
|
||||||
|
};
|
||||||
|
externalStorage = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "This does not deploy a PVC for atticd so an external storage configuration can be used";
|
||||||
|
};
|
||||||
configToml = mkOption {
|
configToml = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = ''
|
default = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue