mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-01 20:46:12 +01:00
87400566be
Signed-off-by: magic_rb <magic_rb@redalder.org>
50 lines
1 KiB
Nix
50 lines
1 KiB
Nix
{lib, ...}: {
|
|
name,
|
|
capacity,
|
|
namespace,
|
|
labels,
|
|
hostPath,
|
|
}: {...}: {
|
|
resource."kubernetes_manifest"."${name}-persistent-volume" = {
|
|
manifest = {
|
|
apiVersion = "v1";
|
|
kind = "PersistentVolume";
|
|
metadata = {
|
|
inherit name labels;
|
|
};
|
|
|
|
spec = {
|
|
capacity.storage = capacity;
|
|
claimRef = {
|
|
inherit name namespace;
|
|
};
|
|
volumeMode = "Filesystem";
|
|
accessModes = [
|
|
"ReadWriteOnce"
|
|
];
|
|
persistentVolumeReclaimPolicy = "Retain";
|
|
storageClassName = "hostpath";
|
|
hostPath.path = hostPath;
|
|
};
|
|
};
|
|
};
|
|
|
|
resource."kubernetes_manifest"."${name}-persistent-volume-clain" = {
|
|
manifest = {
|
|
kind = "PersistentVolumeClaim";
|
|
apiVersion = "v1";
|
|
metadata = {
|
|
inherit name namespace;
|
|
};
|
|
spec = {
|
|
volumeName = name;
|
|
storageClassName = "hostpath";
|
|
accessModes = [
|
|
"ReadWriteOnce"
|
|
];
|
|
resources.requests.storage = capacity;
|
|
};
|
|
};
|
|
};
|
|
}
|