Skip to content

Commit

Permalink
fix(poketwo): exclude hostpaths from velero backup
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Jul 27, 2024
1 parent d3d1aa2 commit 8440ada
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions kubernetes/poketwo/mongodb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ let
}];
};

datadirPvSpec = hostname: {
capacity.storage = "2Ti";
volumeMode = "Filesystem";
accessModes = [ "ReadWriteOnce" ];
persistentVolumeReclaimPolicy = "Retain";
storageClassName = "manual";
local.path = "/mongo";
nodeAffinity = requireHostname hostname;
datadirPv = hostname: {
metadata.labels."velero.io/exclude-from-backup" = "true";
spec = {
capacity.storage = "2Ti";
volumeMode = "Filesystem";
accessModes = [ "ReadWriteOnce" ];
persistentVolumeReclaimPolicy = "Retain";
storageClassName = "manual";
local.path = "/mongo";
nodeAffinity = requireHostname hostname;
};
};

datadirPvcSpec = pvName: {
Expand Down Expand Up @@ -81,8 +84,8 @@ in
};

resources = {
v1.PersistentVolume.datadir-mongodb-0.spec = datadirPvSpec "vaporeon";
v1.PersistentVolume.datadir-mongodb-1.spec = datadirPvSpec "jolteon";
v1.PersistentVolume.datadir-mongodb-0 = datadirPv "vaporeon";
v1.PersistentVolume.datadir-mongodb-1 = datadirPv "jolteon";

v1.PersistentVolumeClaim.datadir-mongodb-0.spec = datadirPvcSpec "datadir-mongodb-0";
v1.PersistentVolumeClaim.datadir-mongodb-1.spec = datadirPvcSpec "datadir-mongodb-1";
Expand Down

0 comments on commit 8440ada

Please sign in to comment.