mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-30 18:03:58 +01:00
feat(kubevirt-youko): serve VM golden images from a shared NFS store (#282)
* feat(kubevirt-youko): export a shared golden-image store over NFS * feat(vm-images): upload golden images into the cluster Replace the rsync-to-orangepi5 step with a CDI upload into the golden-image PVCs (vms/golden-images in k8s-gitops), so VM images no longer depend on the single-board file server.
This commit is contained in:
1 parent
1c3b826c73
commit
a4609501c4
2 files changed
+41
-2
No files matched your search
@@ -0,0 +1,31 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Shared golden-image store for the KubeVirt cluster. It is exported over
|
||||
# NFSv4 so the cluster's NFS CSI driver can hand out RWX volumes to every
|
||||
# node, and VM disks are cloned from it into local-path.
|
||||
#
|
||||
# It lives on the encrypted btrfs pool (/persistent), which has plenty of
|
||||
# free space on this host.
|
||||
goldenDir = "/persistent/nfs/golden";
|
||||
|
||||
# Only the homelab LAN may mount the export. The KubeVirt nodes are the
|
||||
# clients (the CSI node plugin mounts from the node, not from the pod).
|
||||
clientCidr = "192.168.5.0/24";
|
||||
in
|
||||
{
|
||||
# Make sure the export directory exists before the NFS server starts.
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${goldenDir} 0755 root root -"
|
||||
];
|
||||
|
||||
services.nfs.server.enable = true;
|
||||
services.nfs.server.exports = ''
|
||||
${goldenDir} ${clientCidr}(rw,sync,no_subtree_check,fsid=0,no_root_squash)
|
||||
'';
|
||||
|
||||
# NFSv4 only needs 2049/tcp (no rpcbind/mountd/statd), so the firewall stays
|
||||
# minimal. The export itself is already restricted to the LAN CIDR above.
|
||||
networking.firewall.allowedTCPPorts = [ 2049 ];
|
||||
}
|
||||
Reference in new issue
Block a user