-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
rootless: use fuse-overlayfs snapshotter by default #2278
rootless: use fuse-overlayfs snapshotter by default #2278
Conversation
The snapshotter can be overridden with `$KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER`. e.g., `KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER=overlayfs`. Close 2275 Signed-off-by: Akihiro Suda <[email protected]>
Hi @AkihiroSuda. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
CI failure is unrelated
|
oh,you already detected it |
# Configure containerd-fuse-overlayfs snapshotter binary from upstream | ||
ARG CONTAINERD_FUSE_OVERLAYFS_VERSION="1.0.2" | ||
ARG CONTAINERD_FUSE_OVERLAYFS_TARBALL="v${CONTAINERD_FUSE_OVERLAYFS_VERSION}/containerd-fuse-overlayfs-${CONTAINERD_FUSE_OVERLAYFS_VERSION}-linux-${TARGETARCH}.tar.gz" | ||
ARG CONTAINERD_FUSE_OVERLAYFS_URL="https://github.com/containerd/fuse-overlayfs-snapshotter/releases/download/${CONTAINERD_FUSE_OVERLAYFS_TARBALL}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this eventually be merged in? It seems like this is crucial enough to bake in 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the containerd/containerd repo does not accept a new built-in snapshotter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If having a separate binary is not comfortable, maybe we can consider patching kind-ci/containerd-nightlies. (Just adding import _ "github.com/containerd/fuse-overlayfs-snapshotter/plugin"
line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the containerd/containerd repo does not accept a new built-in snapshotter.
That seems unfortunate, especially with it being essentially required for rootless. I hope they may reconsider for this case.
If having a separate binary is not comfortable, maybe we can consider patching kind-ci/containerd-nightlies. (Just adding import _ "github.com/containerd/fuse-overlayfs-snapshotter/plugin" line)
We probably don't want to patch containerd sources, but maybe worth considering if we can do it with our own stub source importing or something.
Users building images for compliance (e.g. EKS AIUI) will still need to update their builds to fix this though. It's less that we need to add a binary to the image and more that there's another unverified binary they may need to notice and start overriding + building. If we keep doing that it makes updating kind a riskier proposition.
It's also a little annoying to need to run more services though / extra entrypoint complexity though and I imagine the binary size is smaller when merged in. But it is not a deal breaker. It's still more important to make sure kind works.
@@ -243,6 +243,11 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n | |||
"--volume", "/var", | |||
// some k8s things want to read /lib/modules | |||
"--volume", "/lib/modules:/lib/modules:ro", | |||
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script | |||
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to not just enable this when rootless and forget the env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This env var is for users who want to opt-in to KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER=overlayfs
(kernel-mode real overlayfs) for better performance.
This env var is not needed for most users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, hopefully in the future there some way we can check if real overlayfs is viable and automate selection.
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script | ||
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER", | ||
// enable /dev/fuse explicitly for fuse-overlayfs | ||
// (Rootless Podman does not automatically mount /dev/fuse with --privileged) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for that? I'm only familiar with the rough concept of fuse 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because fuse-overlayfs
needs /dev/fuse
to mount FUSE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
fuse-overlayfs
needs/dev/fuse
to mount FUSE.
Sorry, that part I get, what I meant was: What's the reason for (the comment):
Rootless Podman does not automatically mount /dev/fuse with --privileged
Why this deviation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda bug / TODO (of runc) due to complexity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it sounds like they don't because it may not be present see e.g. openshift/enhancements#362
btw I'd be happy to sponsor your kubernetes organization membership, which would remove the |
/ok-to-test https://github.com/kubernetes/community/blob/master/community-membership.md#member I'm sure @aojea would be happy to be a second sponsor |
yep, absolutely |
Thanks, opened a request in kubernetes/org#2740 I should have requested this a few years ago... 😅 |
#2287 we're going to cut a release with the runc update / CVE patch, but after that's done I intend to update the base image and move forward with this PR. thank you for your patience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AkihiroSuda, BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER", | ||
// enable /dev/fuse explicitly for fuse-overlayfs | ||
// (Rootless Docker does not automatically mount /dev/fuse with --privileged) | ||
"--device", "/dev/fuse", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if fuse isn't enabled / mounted?
kind v0.11 uses
overlayfs
containerd snapshotter for rootless, but rootless overlayfs has very complex requirement:And yet Debian variant is known to be broken (while Ubuntu variant is not): moby/moby#42302
OTOH, fuse-overlayfs just requires kernel >= 4.18.
The snapshotter can be still rolled back to
overlayfs
by settingKIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER=overlayfs
.Close #2275
Node image: akihirosuda/tmp-kind-node:g42e6ce83-v1.21.1