-
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
Document known issue around BTRFS #2584
Conversation
Following discussions under issue kubernetes-sigs#2411, documenting problem with finding rootfs device with BTRFS (and maybe other unrecognised filesystems), along with the workaround of adding devices as extra mounts. Also threw in a quick reminder at the top of the page about how to obtain logs if cluster creation fails.
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
|
Welcome @simon-geard! |
Hi @simon-geard. 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. |
- hostPath: /dev/nvme0n1p3 | ||
containerPath: /dev/nvme0n1p3 |
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.
should we add some detailed instructions for users on how to obtain the device path?
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.
That's in the following paragraph, where I state "the expected device is named in the error message".
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.
Just in case, in my Fedora 35 it complained about /dev/mapper/luks-903aad3d-...
and using hostPath/containerPath: /dev/mapper/luks-903aad3d-..
didn't worked because it is a symlink to /dev/dm-0
. Using /dev/dm-0
worked.
ls -l /dev/mapper/
total 0
crw-------. 1 root root 10, 236 ene 11 08:06 control
lrwxrwxrwx. 1 root root 7 ene 11 08:06 luks-903aad3d-... -> ../dm-0
cat << EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /dev/dm-0
containerPath: /dev/dm-0
propagation: HostToContainer
EOF
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.
So, two variations - if the device cited in the error message is under /dev/mapper
, the extra mount should be the /dev/dm-* device it points to; otherwise it should be the device from the message?
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.
I guess it needs to be the real device, not a symlink. So if the error complains about /dev/foo/bar
, the config needs to have the real device such as readlink -f /dev/foo/bar
MYDEVICE=$(readlink -f /dev/mapper/luks-903aad3d-...)
cat << EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: ${MYDEVICE}
containerPath: ${MYDEVICE}
propagation: HostToContainer
EOF
/ok-to-test |
"Failed to start ContainerManager" err="failed to get rootfs info: failed to get device for dir \"/var/lib/kubelet\": could not find device with major: 0, minor: 40 in cached partitions map" | ||
``` | ||
|
||
Kubernetes needs access to storage device nodes in order to do some stuff, e.g. tracking free disk space. Therefore, Kind needs to mount the necessary device nodes from the host into the control-plane container — however, it cannot always determine which device Kubernetes requires, since this varies with the host filesystem. For example, Kind doesn't handle BTRFS, which is the default for modern Fedora. |
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.
modern Fedora
-> modern Fedora on Desktop
, IIUC?
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.
Desktop, certainly... I don't know about other variants. But I don't think Fedora itself is relevant to the issue... I mention it only as an example of a common distro where the problem will occur on a stock configuration. I can adjust the wording if you have any suggestions?
propagation: HostToContainer | ||
``` | ||
|
||
The expected device is named in the error message, but will typically be the location where container volumes are stored — for rootless Docker or Podman, this will usually be $HOME. |
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.
Does this workaround really work on rootless?
I also guess rootless may not require this workaround, as it uses fuse-overlayfs?
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 certainly works for Podman on Fedora - and yes, the workaround is definitely required; otherwise I wouldn't have known this issue existed.
|
||
Kubernetes needs access to storage device nodes in order to do some stuff, e.g. tracking free disk space. Therefore, Kind needs to mount the necessary device nodes from the host into the control-plane container — however, it cannot always determine which device Kubernetes requires, since this varies with the host filesystem. For example, Kind doesn't handle BTRFS, which is the default for modern Fedora. | ||
|
||
This can be worked around by including the necessary device as an extra mount in the cluster configuration file. |
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.
I guess, setting $KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER
to native
or fuse-overlafys
may work too?
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.
That I don't know, and can't test right now (it's late at night).
Is that setting documented somewhere? I've been using Kind for about 2 days now, so not an expert by any means.
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.
Ok, did some quick experimenting today. Assuming you're expecting something like:
KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER=native kind create cluster --retain
...then neither native
nor fuse-overlayfs
has any apparent effect. Both fail with the original problem, "stat failed on /dev/nvme0n1p3 with error".
Added a little more explanation about identifying the device to be mounted, since some variations need to deal with symlinked device names.
A question for whomever it might concern — what's still needed in order to get this documentation change merged? I believe I've satisfied the feedback around the change itself, but as someone entirely unfamiliar with the processes surrounding this project, it's not clear if there's anything else I need to do? There's an automated comment advising of a build failure, but this does not seem to have an obvious connection to my change... |
/easycla |
sorry, we have been busy and some reviews slip /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AkihiroSuda, aojea, simon-geard 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 |
easycla pass but cla/linuxfoundation doesn't @mrbobbytables is it ok to override? |
Both CLA are passing now |
Yeah, the CLA thing was my mistake, I think... I thought I'd done it, but there are actually two of them? |
/retest |
Following discussions under issue #2411, documenting problem with finding rootfs device with BTRFS (and maybe other unrecognised filesystems), along with the workaround of adding devices as extra mounts.
Also threw in a quick reminder at the top of the page about how to obtain logs if cluster creation fails.