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

Why is k3s using /var/lib/rancher/k3s/agent/kubelet #840

Closed
deitch opened this issue Sep 25, 2019 · 9 comments
Closed

Why is k3s using /var/lib/rancher/k3s/agent/kubelet #840

deitch opened this issue Sep 25, 2019 · 9 comments
Assignees
Milestone

Comments

@deitch
Copy link

deitch commented Sep 25, 2019

Describe the bug

Various system level utilities that depend on the location of /var/lib/kubelet/ (I came across it when working on CSI) fail, because k3s installs it at /var/lib/rancher/k3s/agent/kubelet/. In this case, it was plugins/, plugins_registry/ and pods/, but I can see others.

To Reproduce

  1. Deploy k3s (which is so nice and easy)
  2. Run anything that looks for it OR ls -l /var/lib/kubelet/

Expected behavior

Standard kubelet directory to exist

Additional context

Even a simple ln -s /var/lib/rancher/k3s/agent/kubelet /var/lib/kubelet would do it.

Oh yes... I love k3s.

@deitch
Copy link
Author

deitch commented Sep 29, 2019

Actually, it gets more complex that that. Apparently the kubelet itself is aware that its path isn't /var/lib/kubelet/ but instead /var/lib/rancher/k3s/agent/kubelet/. This creates CSI problems, as NodeStageVolume passes the mount path /var/lib/rancher/k3s/agent/kubelet/plugins/.... and Unstage passes /var/lib/rancher/k3s/agent/kubelet/pods/<pod-uuid>/volumes/kubernetes.io~csi/pvc-<pvc-uuid>/mount.

Unless you know to mount /var/lib/rancher/ into your CSI DaemonSet pod, this gets really off.

Any reason we aren't using /var/lib/kubelet/?

@ibuildthecloud
Copy link
Contributor

It was just nicer this way, everything was in one directory. But then CSI came along and messed up everything. We might just have to move to /var/lib/kubelet.

I thought a symlink would fix it but you've proven it doesn't.

What if on start we create a bind mount?

@ibuildthecloud
Copy link
Contributor

We'll just move to /var/lib/kubelet.

@deitch
Copy link
Author

deitch commented Oct 2, 2019

I actually thought about working around it, if you could have a mount reference something like this:

      volumes:
        - name: kubelet-dir
          hostPath: kubelet-path-spec

or similar where this would be resolved at runtime by the kubelet to its definition of the Kubelet path (normally /var/lib/kubelet but could be anything), but I don't know of any way to do that.

@ccll
Copy link

ccll commented Oct 14, 2019

We'll just move to /var/lib/kubelet.

Can't wait to see this!
I'm trying to deploy rook-ceph on k3s, and the CSI plugins failed to deploy due to this issue.
Would you kindly share a rough schedule of this fix?
Thanks.

@davidnuzik davidnuzik added this to the v1.0 milestone Oct 15, 2019
@billimek
Copy link

I'm sure you will, but please call-this out as a possible breaking change in release notes when this change ships. We have needed to work around this by hard-coding the /var/lib/rancher/k3s/agent/kubelet path in other things and will need to 'fix' this if/when the k3s default behavior changes.

@ShylajaDevadiga
Copy link
Contributor

With v0.10.0-rc2, we have k3s use the default /var/lib/kubelet directory.

@deitch
Copy link
Author

deitch commented Oct 24, 2019

Thanks. I am going to test it out right away.

@deitch
Copy link
Author

deitch commented Oct 24, 2019

And done. CSI works beautifully. Thanks for the fix!

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

No branches or pull requests

8 participants