Installing on ZFS

There is currently an issue surrounding using MicroK8s on a ZFS filesystem due
to the way containerd is configured. If you have installed MicroK8s on ZFS
you can fix this:

  1. Stop microk8s:

    microk8s stop
    
  2. Remove the old state of containerd:

    sudo rm -rf /var/snap/microk8s/common/var/lib/containerd
    
  3. Configure containerd to use ZFS:
    Edit the file /var/snap/microk8s/current/args/containerd-template.toml
    replacing snapshotter = "overlayfs" with snapshotter = "zfs"

  4. Create new zfs dataset for containerd to use:

    zfs create -o 
    mountpoint=/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.zfs 
    $POOL/containerd
    
  5. Restart microk8s:

    microk8s start
    
1 Like

Thanks for this super concise and helpful post.

When I followed your footsteps, I actually replaced “${SNAPSHOTTER}” with “zfs”. That made me feel a bit uneasy, because I couldn’t for the life of me find the place where that variable is defined and I wonder who else might be using its definition or expect that it’s honored.

1 Like

Thanks @mutech. I believe it comes from the zfs extension for containerd - the source is on github
Oh, i think you mean why your config includes ${SNAPSHOTTER}? I expect it is a change in the defaults for containerd - I will look into it and hopefully provide some more reassuring guidance. Thanks for taking the time to comment.

As @mutech mentioned, appreciate the concise steps to do this. It looks like this is what solved the overlayfs: filesystem on '/var/lib/docker/check-overlayfs-support<random number>/upper' not supported as upperdir (and similar) errors I was experiencing; which is what I was trying to get rid of.

Again, thank you very much! :pray:

PS: did you every find out what the variable was for?