Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Enable kerberos support for NFSv4 #1664

Merged
merged 6 commits into from
Feb 28, 2022
Merged

Conversation

owenthomas17
Copy link
Contributor

@owenthomas17 owenthomas17 commented Feb 22, 2022

Enable kerberos support for NFSv4

Reasons outlined in flatcar/Flatcar#636 - This is an attempt at its implementation

How to use

  • Build a new image
  • Load kernel modules
    • sudo modprobe nfsv3 nfs_acl nfsv4 nfs
    • sudo modprobe rpcsec_gss_krb5
  • Start systemd unit
    • systemctl start rpc-gssd.service
    • systemctl status rpc-gssd.service
      Optionally (all as root)
  • Join the flatcar machine to the domain e.g. realm join -U <da-user>
  • Create a krb5.conf at /etc/krb5.conf if your domain doesn't provide one
  • Generate a kerberos credential cache: kinit -k
  • Mount a kerberos enabled share: mkdir /mnt/test && mount.nfs4 -v -o sec=krb5,vers=4.1 fileserver.domain.local:/test-share /mnt/test

Testing done

These steps have been tested with the flatcar SDK on the flatcar-3127 branch, we produced an OpenStack VM and have tested with the Openstack images. The qemu image also appeared to have the correct packages and kernel modules installed although we didn't perform an end to end test with it.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

use_flags: Adding use flags for nfs-utils so that it can support kerberos and nfs4.1 along with various other tools like junctions
kernel: Including relevent kernel modules for  systemd unit
@jepio
Copy link
Contributor

jepio commented Feb 22, 2022

With this:

wget  https://raw.githubusercontent.com/flatcar-linux/flatcar-build-scripts/master/package-diff
FILE=flatcar_production_image_contents.txt bash package-diff 2022.02.20+dev-main-nightly-4904 2022.02.22+dev-flatcar-master-4923

we get the following image diff relative to the last nightly:
diff.txt

This looks fine to me. @pothos can you give this a third pair of eyes, there might be something that I'm missing? @JAORMX has also reviewed this already.

@jepio jepio requested a review from a team February 22, 2022 18:02
Copy link
Contributor

@pothos pothos left a comment

Choose a reason for hiding this comment

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

Thanks, I think you can also add a changelog entry or even better create a docs section on how to use this.

@owenthomas17
Copy link
Contributor Author

Thanks for the reviews all.
@pothos - Those suggestions sound sensible. In order for me to write some docs it will take a bit more time. Would you mind if I raise this in a separate PR? I can link it back to the RFE as well.

@pothos
Copy link
Contributor

pothos commented Feb 22, 2022

Then let's create a changelog entry now, e.g. changelog/changes/2022-02-22-enable-kerberos-for-nfsv4.md:

- Enabled Kerberos support for NFSv4 in kernel and userspace tools ([PR#1664](https://github.com/flatcar-linux/coreos-overlay/pull/1664))

changelog: Adding changlog entry for nfs with kerberos
@owenthomas17
Copy link
Contributor Author

@pothos - Added a commit with the changelog, thanks again.

changelog: I hope these commits are squashmerged :) Adding missing backtick
@@ -0,0 +1,6 @@
- Bring in dependencies for NFS4 with Kerberos both in kernel and userspace. Tested against NFS4.1. [PR#1664](https://github.com/flatcar-linux/coreos-overlay/pull/1664)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit long now for the release notes. Since we link to this PR here which also has the same info, I suggest to shorten it to one bullet point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, removed in latest commit.

changelog: simplify changelog back to just a pointer to the PR
@pothos pothos merged commit 154dae6 into flatcar-archive:main Feb 28, 2022
da-x pushed a commit to vast-data/coreos-overlay that referenced this pull request Mar 3, 2022
NFS4 with Kerberos

use_flags: Adding use flags for nfs-utils so that it can support kerberos and nfs4.1 along with various other tools like junctions
kernel: Including relevent kernel modules for  systemd unit

Co-authored-by: Owen Thomas <owen@owen-thomas.co.uk>
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants