简体   繁体   English

LXC 和 ZFS 问题中的 K0s

[英]K0s in LXC and ZFS issues

I'm trying to get K0s working in LXC (LXD) containers on Ubuntu 20.04 using ZFS and I've managed to get past the apparmor challenges (for now at least) but stuck on overlayfs issues during the install phase.我正在尝试使用 ZFS 让 K0s 在 Ubuntu 20.04 上的 LXC (LXD) 容器中工作,并且我已经设法克服了 apparmor 挑战(至少现在),但在安装阶段遇到了 overlayfs 问题。

kernel: [1617529.987422] overlayfs: filesystem on '/var/lib/k0s/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/6371/fs' not supported as upperdir

Has anyone hit on this issues before and has a solution/workaround?以前有没有人遇到过这个问题并有解决方案/解决方法?

Regards, Matt问候, 马特

containerd needs to be told to use the zfs snapshotter: containerd需要被告知使用zfs snapshotter:

This approach will probably require the LXD container to run privileged & require the zfs modules passed through to the container.这种方法可能需要 LXD 容器以特权方式运行并且需要将zfs模块传递给容器。

With k0s it is also useful during the configuration above so containerd is found to add to your bash profile:对于k0s ,它在上面的配置过程中也很有用,因此发现containerd添加到您的bash配置文件中:

  • export PATH=$PATH:/var/lib/k0s/bin

Alternative Approach (unprivileged LXD)替代方法(非特权 LXD)

Adding an ext4 zvol to the container for containerd will probably be less problematic & is better from a security perspective as the container can run unprivileged .ext4 zvol添加到 containerd 的containerd中可能会减少问题,并且从安全角度来看更好,因为容器可以非特权运行 This approach works with k3s & /var/lib/rancher/k3s/agent/containerd running on LXD with zfs :这种方法适用于使用zfs在 LXD 上运行的k3s & /var/lib/rancher/k3s/agent/containerd

ZFS 非特权 LXD 上的 k3s

  • /var/lib/kubelet seems to mount itself under zfs ok on k3s version v1.22.7+k3s1 /var/lib/kubelet似乎在k3s version v1.22.7+k3s1上安装在zfs

  • Using rootless overlayfs for the snapshotter works now on Ubuntu 22.04 thanks to this patch .由于此补丁,现在可以在Ubuntu 22.04上使用无根覆盖文件作为快照程序。 It uses less space ( 639MB versus 1.9GB ) & gives better performance than the native snapshotter.它使用更少的空间( 639MB1.9GB )并且提供比本快照程序更好的性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM