feat: add cachefilesd extension - #1183
Conversation
Add cachefilesd (FS-Cache backend daemon) and the cachefiles kernel module under storage/. With an NFS mount using the "fsc" option, reads are cached on the node's local disk. Requires a kernel with CONFIG_FSCACHE=y and CONFIG_NFS_FSCACHE=y. Signed-off-by: Christian A. Jacobsen <christian@jenkins.no>
| - bind | ||
| - ro | ||
| # cachefilesd binary | ||
| - source: /usr/local/sbin |
There was a problem hiding this comment.
do we need it to be on the host? or can it be self-contained contianer rootfs?
There was a problem hiding this comment.
Yeah, that is probably the better solution. I mirrored what was done in lldpd so everything is in a self-contained rootfs now.
| - bind | ||
| - ro | ||
| # cache root, rw: the cachefiles kernel module sets xattrs on it | ||
| - source: /var/cache/fscache |
There was a problem hiding this comment.
I understand that Talos at the moment doesn't support a nice way to handle this, but it almost feels like this is too restrictive, e.g. this doesn't allow a user volume to be used for the cache.
I might need to think a bit more about this specific usecase
There was a problem hiding this comment.
Agreed it's restrictive. /var being ephemeral works for my use case, but yes - it would be strictly better with a user volume. I'm not hitched to any solution, so I'll go with whatever suggestion you think is best. You know this stack better than I.
| - bind | ||
| - ro | ||
| # config file | ||
| - source: /usr/local/etc/cachefilesd.conf |
There was a problem hiding this comment.
Talos now supports custom EtcFileConfig to allow users to override configuration, I wonder if the extension shouldn't ship any, and instead bind-mount the file from /etc which is user-managed...
There was a problem hiding this comment.
Looked at this and ran into a wrinkle: machined os.MkdirAlls any missing bind-mount source, so a bind-mounted /etc/cachefilesd.conf would be created as a directory when the user doesn't supply one, which would break the daemon. So the default config now lives in the container rootfs, and users can override it via ExtensionServiceConfig. I'm happy to switch to depends: configuration: true with no defaults if you prefer that instead.
There was a problem hiding this comment.
you need to add a file dependency, so when etcfileconfig creates only the service tries to start
There was a problem hiding this comment.
Ahh, I see. That makes more sense. I hope I got it right this time. At least it works "as intended" in a Qemu cluster on my Mac 😄
smira
left a comment
There was a problem hiding this comment.
please add yourself to MAINTAINERS for this extension
Signed-off-by: Christian A. Jacobsen <christian@jenkins.no>
|
I'll squash any fixups before merge, but it's easier to track the fixes this way instead of force-pushing. |
Adds cachefilesd: NFS mounts with the
fscoption cache reads on local disk.Depends on: siderolabs/pkgs#1636