···87 boot.kernelModules = [ "rbd" ];
88```
8990-## ZFS Snapshot Support
9192-K3s's builtin containerd does not support the zfs snapshotter. However, it is possible to configure it to use an external containerd:
00930094```
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-];
122```
···87 boot.kernelModules = [ "rbd" ];
88```
8990+## ZFS ContainerD Support
9192+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:
9596+```bash
97+$ zfs create -o mountpoint=/var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.zfs <zpool name>/containerd
98```
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+ ];
000000000000000000108```