Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nfsd support as module package #713

Closed
wants to merge 1 commit into from
Closed

Conversation

TMaYaD
Copy link

@TMaYaD TMaYaD commented Apr 26, 2023

Build nfsd support as module package. This allows to build an nfsd extension to be used with projects like openebs/dynamic-nfs-provisioner.

Talos can load it via machine-config:

machine:
    # Configures the kernel.
    kernel:
        # Kernel modules to load.
        modules:
            - name: nfsd # Module name.

@@ -0,0 +1,9 @@
CONFIG_NFSD=m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we simply build nfsd as a module as part of the main kernel build @frezbo ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we update the the Kconfig and only build the modules that we ship by default in talos, then these extra can be build as separate modules shipped as extensions, so we don't increase initramfs size

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, okay... makes sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the same approach as I'm taking here. Right?

LMK if there is anything else needed to get this approved and merged in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the same approach as I'm taking here. Right?

meant adding to the actual kernel config under kernel/build/config-<arch>, I'll try to experiment and see if that approach works for our use case. Might take a while

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't currently figure out where kernel is being used to build installer. If you can point me, I'll be more than happy to run a few experiments of my own.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/siderolabs/talos/blob/main/Dockerfile#L77-L99 you can update this with your kernel image and do make installer PUSH=true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question: does this work without rpc service running?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TMaYaD does this require rpc service? Else I can fix this up and get this merged.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked on this a while back and don't remember how I got this working. I'll check and get back to you.

Build nfsd support as module package. This allows to build an nfsd
extension to be used with projects like openebs/dynamic-nfs-provisioner.

Talos can load it via machine-config:
```yaml
machine:
    # Configures the kernel.
    kernel:
        # Kernel modules to load.
        modules:
            - name: nfsd # Module name.
```

Signed-off-by: Subhash Chandra <[email protected]>
@tyriis
Copy link

tyriis commented Apr 10, 2024

any chance to get this pushed?

@AngellusMortis
Copy link

With 1.8 having a lot of focus on improving volume management, this might be a great thing to try to get in.

@cm-enfuse
Copy link
Contributor

I am attempting to update this PR. I have managed to build nfsd on the following branch:
https://github.com/cm-enfuse/talos-pkgs/tree/nfsd

I have managed to get an image built that has the module available, but, since I didn't sign it(?) it refuses to load. Would it be possible to get a pointer to how to do that so I can verify the module works as expected?

host: kern: notice: [2025-02-28T23:03:43.913581228Z]: Loading of module with unavailable key is rejected
host: user: warning: [2025-02-28T23:03:43.914382228Z]: [talos] controller failed {"component": "controller-runtime", "controller": "runtime.KernelModuleSpecController", "error": "error loading module \"nfsd\": load nfsd failed: key was rejected by service"}

In regard to rpc, only nfs v4 can run without rpc. If you take a look at the nfsd.conf file, it should be the only version that is being built and should only enable v4. If I can get the module to load, I will confirm as it is my assumption that there is no currently running rpc service per the pervious comments.

Thank you for any help! If this was the wrong place to put this, please let me know and I will delete and move to the right location.

The other relevant branches for the rest of the stack:
https://github.com/cm-enfuse/talos-extensions/tree/nfsd
https://github.com/cm-enfuse/talos/tree/nfsd

@smira
Copy link
Member

smira commented Mar 3, 2025

@cm-enfuse thanks for taking this effort further, we have a guide on building Talos with a custom kernel: https://www.talos.dev/v1.9/advanced/customizing-the-kernel/

You need to build both kernel & modules to get signatures in sync.

You can add nfsd module(s) into hack/modules-amd64.txt in Talos to get it shipped as part of the initial boot assets, so it's easy to test it.

@cm-enfuse
Copy link
Contributor

cm-enfuse commented Mar 3, 2025

@smira Many thanks, I hadn't built the imager and that was the crux of the problem.

With the above changes in place, I was able to successfully run an nfs server container, with privileged, and externally mount it and verify a file was written.

I am making a new PR for review now.

@cm-enfuse
Copy link
Contributor

Created new PR. Thank you for your help; let me know what I need to do in order to get past all the failing checks. I apologize for thrash on that part.
#1174

@smira
Copy link
Member

smira commented Mar 4, 2025

@cm-enfuse thank you, I will close this PR, and make sure your PRs are merged for Talos 1.10!

@smira smira closed this Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants