-
Notifications
You must be signed in to change notification settings - Fork 381
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
k0s should move /var/lib/k0s/kubelet to /var/lib/kubelet #1842
Comments
It's a bug of aws-ebs-csi-driver helm chart. I've submitted a fix: kubernetes-sigs/aws-ebs-csi-driver#1276 As a workaround you can try to add the following to the values:
|
This isn't working for me. ebs-csi-node goes into a crashloop. |
Sorry, I should have pointed out explicitly that you also need to specify the correct
|
We've definitely seen some issues in our non-default location for kubelet data dir. The main motivation for keeping everything under
For changes like these, we need to also think hard on backwards compatibility. And especially in this case it's super difficult to actually change the kubelet directory. There's really no easy way to do an update for k0s, and thus for kubelet, in a way where we would not have to do a full reset first. We do get that it's bit inconvenient in some cases, but as kubelet itself has a config option for the data-dir it uses, it's really pretty much always an upstream issue if those are not configurable. Yes, people make assumptions, but in this case those are kinda false assumptions. :) What we (the k0s team) can do here is to always help out in figuring out why something is not working with k0s and help making it work. Just like @makhov did now for the EBS CSI helm charts. |
The issue is marked as stale since no activity has been recorded in 30 days |
Closing the issue, since the fix for the EBS CSI helm chart was merged and we can't do more here. Feel free to reopen it as needed. |
this is still a huge pain point |
I agree. Had to debug an enterally day to discover what was the problem. For 1 of 2 Plugins, I solved it by adding a symbol link |
I think they mean for us to "just" fork k0s and fix the path, which will have nothing but positive impacts on using it |
@aronwolf90 @doctorpangloss If the symlink doesn't work, what about a bind mount? Could you maybe try Moreover, which plugins are you using that are lacking support for custom kubelet paths? |
/cc #3508 which is similar, but the other way round. |
@twz123 thanks for your time. In my case, it is an older version of https://github.com/hetznercloud/csi-driver (1.6) and yes, it can be fixed by downloading the yaml of csi-driver and adjust it (what is exactly what I did). The problem that I see here is, that I think that many others would have given up before finding the solution. For my cluster, it is now fine as it is, but it is definitely a minus point when I have to consider what k8s distro I should recommend to others. This makes me a little sad because I really like the rest of k0s. NOTE: |
The issue is marked as stale since no activity has been recorded in 30 days |
The issue is marked as stale since no activity has been recorded in 30 days |
I found that the "zero friction" moniker of k0s to be a bit misleading. Moving the kubelet folder is quite problematic. Here is how I solved it:
You have to run essentially the same series of commands on the control plane and all the workers before installing, otherwise some folders cannot be moved or overwritten due to locked .sock files. |
Running into to the same issue installing the AWS EFS CSI. As simple fix could be to just add the symlink for kubelet at /var/lib/kubelet - which appears to the common accepted behaviour. |
Well that is a work-around. The proper thing would be to have the kubelet folder to be an optional setting. |
But consider this, the path is actually configurable on upstream kubelet itself: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options (search for And no, I'm not saying k0s couldn't do something for this but we have to be very careful not to break backwards compatibility promises too for our users. I.e. if you've already configured your CSI provider with the correct k0s path and we'd change it, your CSI would get broken (again). So it's not just as simple as "let's change it to kubelet default from now on". |
I'm not saying change the default. Just that it can be a configurable parameter that the user can control. |
Yes, absolutely make it an install option. But also realize defaults should be chosen to cause the least effort on the user. I would hope that means using /var/lib/kubelet unless instructed otherwise. The new user experience is difficult because of the chosen path. If it were exposed as an option, I would venture the majority of existing users would eventually reinstall to get back to the standard path. Unfortunately lots of downstream packages assume paths and are not configurable, or are a lot of work to configure. Either way, making it an install time option to generate symlinks would be very helpful. |
I'm unable to get kubevirt running with k0s due to this without additional magic on the host system. To be fair, kubevirt has a similar issue open as you can see here: kubevirt/kubevirt#5913 Additional notes if you're curious: Its possible to re-configure the kubelet path in kubevirt: https://github.com/kubevirt/kubevirt/blob/c205d1dd1bf69a9ae7bc33b6e76b4896c0c76546/cmd/virt-handler/virt-handler.go#L618-L619 People used a symlink from |
Just to add to this, a similar problem can be observed using the What happens in that case is the problem described here [1] where the contents written to an NFS volume backed by the NFS CSI driver gets written into the container file system rather than to the NFS share itself. As seen in the issue discussion, the problem relates to the non-standard kubelet path and the suggested fix is to install the NFS CSI driver specifying the actualy default kubelet directory with For this particular situation, even though I have a bind mount from Even though that, thankfully this driver allows to be installed in a different location, it's understood that bind mounting the kubelet directory doesn't actually solve the issue, especially involving the storage interface drivers. Having said that, I also think that being able to select an alternative kubelet directory as a configuration parameter prior to provisioning k0s would be ideal. |
@BinaryDevotee Did you try using https://askubuntu.com/questions/1122975/difference-between-rbind-and-bind-in-mounting |
I have redeployed the controller nodes with the kubelet directories
But the behavior seems to be the same. The share gets created in the NFS server but the contents are empty whereas the data resides within the container file system. For now it's not a blocker as I can override the default kubelet directory as a install parameter of the NFS CSI driver. I appreciate nevertheless the suggestion. Thank you. |
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
The following commands maybe the workaround. single try mount --bind /var/lib/k0s/kubelet /var/lib/kubelet persistent change
|
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes: k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Storage drivers and others may hardcode /var/lib/kubelet which confilicts with the k0s default /var/lib/k0s/kubelet. Allow users to override the kubelet root directory with --kubelet-root-dir similar to the way they can override --data-dir. ref: https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/ fixes: k0sproject#1842 Signed-off-by: Natanael Copa <[email protected]>
Before creating an issue, make sure you've checked the following:
Version
1.23.6
Platform
What happened?
aws-ebs-csi-driver out of the box failed to work with k0s.
Steps to reproduce
Expected behavior
PVC creation via aws-ebs-csi-driver works
Actual behavior
PVC creation via aws-ebs-csi-driver fails
Screenshots and logs
Jun 13 05:53:05 nexus-nexus-01 k0s[4738]: time="2022-06-13 05:53:05" level=info msg="E0613 05:53:05.391274 4928 nestedpendingoperations.go:335] Operation for "{volumeName:kubernetes.io/csi/ebs.csi.aws.com^vol-0e2e37e9eecca4a86 podName: nodeName:}" failed. No retries permitted until 2022-06-13 05:54:09.391247943 +0000 UTC m=+1996.540517455 (durationBeforeRetry 1m4s). Error: MountVolume.SetUp failed for volume "pvc-21851630-5134-4690-9807-91e57ef51902" (UniqueName: "kubernetes.io/csi/ebs.csi.aws.com^vol-0e2e37e9eecca4a86") pod "nexus-repo-nexus-repository-manager-5b5ff457c5-n5k9l" (UID: "753df29d-d7de-4d68-bd24-1538e1b1eafc") : applyFSGroup failed for vol vol-0e2e37e9eecca4a86: lstat /var/lib/k0s/kubelet/pods/753df29d-d7de-4d68-bd24-1538e1b1eafc/volumes/kubernetes.io~csi/pvc-21851630-5134-4690-9807-91e57ef51902/mount: no such file or directory" component=kubelet
Additional context
The issue is that
aws-ebs-csi-driver
expects things in/var/lib/kubelet
not/var/lib/k0s/kubelet
.Things tried:
/var/lib/kubelet
to/var/lib/k0s/kubelet
/var/lib/k0s/kubelet
to/var/lib/kubelet
/var/lib/k0s/kubelet
to/var/lib/kubelet
aws-ebs-csi-driver
helm chart by hand to use/var/lib/k0s/kubelet
Results:
In the process of tracking down this issue I ran across multiple previous
k0s
issues and multiple CSI driver issues across GitHub projects that all point to many Kubernetes projects assume/var/lib/kubelet
. The ideal would be for it to always be configurable, but the reality is that people do assume. The ultimate issue is thatk0s
is breaking compatibility with a lot of other projects by changing the directory from/var/lib/kubelet
to/var/lib/k0s/kubelet
.The text was updated successfully, but these errors were encountered: