k3s: weekly image-refresh timer (pull floating tags + prune); NFS client support
This commit is contained in:
1 parent
71d7c6bb32
commit
ceee856b3c
1 file changed
+23
@@ -24,4 +24,27 @@
|
|||||||
"ro"
|
"ro"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Weekly rolling refresh: restart all deployments so floating :latest images
|
||||||
|
# are re-pulled, then prune dangling images.
|
||||||
|
systemd.services.image-refresh = {
|
||||||
|
description = "Pull latest floating images by restarting all deployments, then prune";
|
||||||
|
path = [ "/run/current-system/sw/bin" ];
|
||||||
|
script = ''
|
||||||
|
/run/current-system/sw/bin/k3s kubectl rollout restart deployments -A
|
||||||
|
sleep 120
|
||||||
|
/run/current-system/sw/bin/k3s crictl rmi --prune || true
|
||||||
|
'';
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.image-refresh = {
|
||||||
|
description = "Weekly image refresh";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "Sun *-*-* 04:30:00";
|
||||||
|
Persistent = true;
|
||||||
|
RandomizedDelaySec = "10m";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user