docs: updated zfs snapshotter support for k3s

authored by jcstryker and committed by GitHub 62092edb f5606187

+15 -29
+15 -29
pkgs/applications/networking/cluster/k3s/docs/examples/STORAGE.md
··· 87 87 boot.kernelModules = [ "rbd" ]; 88 88 ``` 89 89 90 - ## ZFS Snapshot Support 90 + ## ZFS ContainerD Support 91 91 92 - K3s's builtin containerd does not support the zfs snapshotter. However, it is possible to configure it to use an external containerd: 92 + The [ZFS snapshotter](https://github.com/containerd/zfs) can be enabled for k3s' embedded ContainerD though it requires mounting a dataset to a specific path used by k3s: `/var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.zfs` 93 + 94 + For example: 93 95 96 + ```bash 97 + $ zfs create -o mountpoint=/var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.zfs <zpool name>/containerd 94 98 ``` 95 - virtualisation.containerd = { 96 - enable = true; 97 - settings = 98 - let 99 - fullCNIPlugins = pkgs.buildEnv { 100 - name = "full-cni"; 101 - paths = with pkgs;[ 102 - cni-plugins 103 - cni-plugin-flannel 104 - ]; 105 - }; 106 - in { 107 - plugins."io.containerd.grpc.v1.cri".cni = { 108 - bin_dir = "${fullCNIPlugins}/bin"; 109 - conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d/"; 110 - }; 111 - # Optionally set private registry credentials here instead of using /etc/rancher/k3s/registries.yaml 112 - # plugins."io.containerd.grpc.v1.cri".registry.configs."registry.example.com".auth = { 113 - # username = ""; 114 - # password = ""; 115 - # }; 116 - }; 117 - }; 118 - # TODO describe how to enable zfs snapshotter in containerd 119 - services.k3s.extraFlags = toString [ 120 - "--container-runtime-endpoint unix:///run/containerd/containerd.sock" 121 - ]; 99 + 100 + You can now configure k3s to use zfs by passing the `--snapshotter` flag. 101 + 102 + ``` 103 + services.k3s = { 104 + ... 105 + extraFlags = [ 106 + "--snapshotter=zfs" 107 + ]; 122 108 ```