Repository navigation
feat(os): NFS client (nfs-utils + rpcbind, client-only) in the base image - #295
Merged
Merged
Conversation
rpc.statd (NFSv3 locking) registers its listener with the local rpcbind and exits when there is none, and NFS servers look statd up through port 111 to send SM_NOTIFY after a reboot. FSDK 26.08 ships libtirpc but no rpcbind, so build 1.3.1 from the upstream tarball: warm starts in /run/rpcbind (created by rpcbind itself), running as a fixed-uid "rpc" sysusers.d account, with upstream's rpcbind.service/rpcbind.socket for socket activation. Refs projectbluefin#294 Assisted-by: Claude Fable 5.1 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Without /sbin/mount.nfs, util-linux mount(8) hands "-t nfs" to the new
mount API and the kernel refuses it ("fsconfig() failed: NFS: mount program
didn't pass remote address"), so every kubelet NFS PV fails with exit
status 32. FSDK 26.08 has libtirpc and keyutils but no nfs-utils element.
Build nfs-utils 2.8.7 from the upstream tarball, client only: mount.nfs,
mount.nfs4, umount.nfs, rpc.statd, sm-notify, start-statd, nfsidmap,
nfsstat, showmount, rpcdebug, nfsconf, nfsrahead, with upstream's
nfs-client.target, rpc-statd*.service and udev rules. Configured with
--disable-sbin-override so the helpers honour sbindir (FSDK's /usr/sbin is
a symlink to bin, reached from mount's /sbin search path via the
/sbin -> usr/sbin link switch-root creates), --enable-libmount-mount, and
GSS, nfsdcld/nfsdcltrack/nfsdctl, the NFSv4 server, junctions, LDAP and
tcp-wrappers off. The always-built server pieces (rpc.nfsd, rpc.mountd,
exportfs, fsidd, rpc.idmapd, their units, rpc_pipefs, the generators), the
python tools and the internal rpcgen are dropped after install.
/usr is read-only and /var starts empty, so /var/lib/nfs/statd comes from
tmpfiles.d, owned by a fixed-uid rpcuser account (sysusers.d) that
rpc.statd and sm-notify drop to; drop-ins order both units after
systemd-tmpfiles-setup. NFSv4 id mapping goes through the request-key
upcall (id_resolver.conf in the factory /etc). 80-bluefin-nfs.preset
enables nfs-client.target and rpcbind.socket and keeps rpcbind.service off:
mount.nfs starts rpc-statd.service on demand for NFSv3 locking.
Fixes projectbluefin#294
Assisted-by: Claude Fable 5.1 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Parsed-property assertions on nfs-utils.bst and rpcbind.bst: pinned upstream tarballs, FSDK autotools sandbox, the client-only configure set (--disable-sbin-override, libmount, no GSS/server bits), statd state from tmpfiles.d and sysusers.d with nothing shipped under /var, socket-activated rpcbind, and a preset that enables only nfs-client.target and rpcbind.socket. Refs projectbluefin#294 Assisted-by: Claude Fable 5.1 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
What the base image ships for NFS volumes, why (the fsconfig() failure without mount.nfs), what is left out (server, GSS) and the diskless caveat for NFSv3 lock notification. Refs projectbluefin#294 Assisted-by: Claude Fable 5.1 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
HUMAN DECISION NEEDED — @jeefy: merge without an end-to-end mount -t nfs on a booted node (PR body: "Not boot-tested on hardware yet"), or require that check first? This reviewer cannot boot the image.
Reviewed at fccf8c8.
security
files/os/systemd/system-preset/80-bluefin-nfs.preset:7enablesrpcbind.socketat boot on every node. Upstreamrpcbind.socket(rpcbind 1.3.1systemd/rpcbind.socket.in) listens TCP+UDP0.0.0.0:111and[::]:111, and the image ships no firewall. The boot-time listener buys nothing:rpc-statd.service(nfs-utils 2.8.7systemd/rpc-statd.service) carriesRequires=rpcbind.socket, sostart-statd→systemctl start rpc-statd.servicealready pulls the socket in on the first NFSv3 locking mount, andrpc-statd-notify.service/nfs-client.targetdo not need rpcbind. Servers only send SM_NOTIFY to a client whose statd is running, which implies the socket is already up. Suggest droppingenable rpcbind.socket(optionallydisable rpcbind.socket) so port 111 is open only while NFSv3 locking is in use; updatetests/unit/test_nfs_client.py:104,115accordingly.
correctness
- The change's sole purpose —
/sbin/mount.nfsfound by util-linux and a workingmount -t nfs— is unverified at runtime;tests/unit/test_nfs_client.pyonly checks element YAML. I verified the path chain (FSDK 26.08elements/bootstrap/symlinks:sbin -> usr/bin,usr/sbin -> bin;include/install-dirs.yml:5sbindir: %{bindir}) and thatrpc-statd.service's hardcoded/usr/sbin/rpc.statdresolves, and thatsystemd-sysusers.serviceruns beforesystemd-tmpfiles-setup.servicesorpcuserinusr/lib/tmpfiles.d/nfs-utils.conf(elements/bluefin-server/nfs-utils.bst:129-134) resolves on an empty/etc. What remains unverifiable here is the boot: one NFSv3 (locking → statd/rpcbind) and one NFSv4 mount on a dogfood node.
No findings from: intent-alignment, style, docs-currency.
Confidence: 3/5 (needs attention) — 2 medium findings
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #294
Why
Bluefin Server has the NFS kernel client (
nfs/nfs4in/proc/filesystems) but no userspace helper:nfs-utilsis not inos-base.bstand FSDK 26.08 ships nocomponents/nfs-utils.bst(onlylibtirpc.bstandkeyutils.bst). Without/sbin/mount.nfs, util-linuxmount -t nfsfalls through to the new mount API and the kernel refuses:Reproduced on a 26.09.730 kubeadm worker: every kubelet NFS PV mount fails (
MountVolume.SetUp failed … exit status 32), so clusters with an NFS provisioner cannot schedule those workloads on Bluefin Server nodes. iSCSI is already covered byopen-iscsiin os-base; NFS was the gap. Flatcar ships nfs-utils.What
Two project-local
kind: manualelements built from pinned upstream tarballs (the repo does not register theautotoolsplugin; same shape aszfs/openzfs.bstandignition/gptfdisk.bst), added toos-base.bstafter open-iscsi:bluefin-server/nfs-utils.bst(nfs-utils 2.8.7, kernel.org, sha256 from the signedsha256sums.asc) — client only:mount.nfs,mount.nfs4,umount.nfs,umount.nfs4,rpc.statd,sm-notify,start-statd,nfsidmap,nfsstat,showmount,rpcdebug,nfsconf,nfsrahead,libnfsidmap+ plugins, upstreamnfs-client.target,nfs-utils.service,rpc-statd.service,rpc-statd-notify.service,60-nfs.rules,99-nfs.rules--disable-sbin-override(FSDK'ssbindiris/usr/bin;/usr/sbin -> binin FSDK and systemd's switch-root creates/sbin -> usr/sbin, so util-linux's/sbinhelper search path reaches it),--enable-libmount-mount,--with-rpcgen=internal,--with-systemd=/usr/lib/systemd/system,--with-statdpath=/var/lib/nfs/statd,--with-statduser=rpcuser--disable-gss --disable-svcgss(no krb5 in the image;sec=krb5*unsupported),--disable-nfsdcld --disable-nfsdcltrack --disable-nfsdctl --disable-nfsv4server(server-side; nfsdctl needs libnl/readline),--disable-junction(libxml2),--disable-ldap,--without-tcp-wrappersrpc.nfsd,rpc.mountd,exportfs,fsidd,rpc.idmapd,nfs-server.service,nfs-mountd.service,nfs-idmapd.service,fsidd.service,proc-fs-nfsd.mount,var-lib-nfs-rpc_pipefs.mount,rpc_pipefs.target, the three generators, the python tools (mountstats,nfsiostat,rpcctl,nfsdclnts— no python in the image), the internalrpcgen, and everything under/var(the install hook seedsetab/rmtab/statd dirs;/usris what the erofs carries). It then asserts the client files are present./usr/lib/tmpfiles.d/nfs-utils.confcreates/var/lib/nfsand/var/lib/nfs/statd{,/sm,/sm.bak}(0700rpcuser);/usr/lib/sysusers.d/nfs-utils.confaddsrpcuser(uid 29, Fedora's) —systemd-sysusersruns at image build so it lands in the factory/etc.rpc.statd/sm-notifydrop privileges to the owner ofsm/. Drop-ins order both unitsAfter=systemd-tmpfiles-setup.service+RequiresMountsFor=/var/lib/nfs/statd(they haveDefaultDependencies=no)./etc/request-key.d/id_resolver.conffor the kernel's NFSv4 id-mapping upcall tonfsidmap(keyutils'request-keyis already in FSDK).bluefin-server/rpcbind.bst(rpcbind 1.3.1, sourceforge, matches Fedora rawhide):rpc.statdregisters with the local rpcbind and exits when there is none (nfs_svc_create→ "failed to create RPC listeners"), and upstreamrpc-statd.servicehasRequires=rpcbind.socket, so shipping statd without rpcbind would leave a broken unit.--enable-warmstarts --with-statedir=/run/rpcbind --with-rpcuser=rpc(uid 32 via sysusers.d), upstreamrpcbind.service/rpcbind.socket.files/os/systemd/system-preset/80-bluefin-nfs.preset(FSDK has no catch-alldisable *):enable nfs-client.target,enable rpcbind.socket,disable rpcbind.service. Nothing runs at boot exceptsm-notifyonce (exits immediately with no state) and the portmapper socket;mount.nfsstartsrpc-statd.serviceviastart-statdonly when an NFSv3 mount needs locking, which socket-activates rpcbind. NFSv4 needs neither.include/aliases.ymlgainskernel_pub: https://www.kernel.org/pub/.Tests
tests/unit/test_nfs_client.py: parsed-property contracts (pinned tar sources, autotools sandbox, client-only configure set, server bits removed, tmpfiles/sysusers, nothing under/var, socket-activated rpcbind, preset enables only the two units).just test-unit: 594 pytest + 74 bats pass.just validatepasses.python3 .github/scripts/docs-checks.pypasses.Built locally
just bst build bluefin-server/nfs-utils.bst(and rpcbind) succeed in the bst2 container;bst artifact checkout --deps noneof nfs-utils gives:mount.nfsNEEDED: libtirpc.so.3, libmount.so.1;rpc.statd: libcap.so.2, libtirpc.so.3;rpcbind: libtirpc.so.3, libsystemd.so.0. No/varin the artifact. Not boot-tested on hardware yet — CI's image build and dogfood cover the compose; an NFS mount from a booted node is the remaining verification.Notes / caveats
mount.nfsis not setuid (the CAS drops mode bits, like FSDK'smount): fine for kubelet/root; unprivilegeduserNFS mounts would need the same initial-script treatment as fix(ddi): restore the setuid/setgid bits Flatcar ships on sudo, su, passwd, mount, … #255.rpcbind.socketbinds0.0.0.0:111/[::]:111at boot (upstream unit, same as Fedora/Flatcar). Remote NFSv3 servers need it to reachrpc.statdfor SM_NOTIFY, so it cannot be loopback-only./var/lib/nfs/statdat reboot, so an NFSv3 server holding locks for a rebooted diskless client is not notified. Inherent to stateless clients; NFSv4 (lease-based) is unaffected.docs/skills/kubeadm-sysext.mdgains an "NFS" section next to "iSCSI".