Addon: NFS Server Provisioner

Supported arch: amd64

Enabling this addon will add NFS Ganesha Server and Provisioner to MicroK8s, running as a pod. The components will be installed and connected together. Unlike the standard hostpath-storage, this addon can provide storage to any node which is part of the cluster.

To enable the addon first make sure you have installed the appropriate nfs package on all MicroK8s nodes to allow Pods with NFS mounts (eg sudo apt install -y nfs-common). Afterwards you can call:

microk8s enable nfs

To enable the addon for a specific node, you can run:

microk8s enable nfs -n <NODENAME>

The created storage class, nfs, can be used to create a pvc using the following YAML :

kind: PersistentVolumeClaim
apiVersion: v1
  name: pvc-nfs
    vol: pvc-nfs
  namespace: default
  storageClassName: "nfs"
    - ReadWriteMany
      storage: 1Gi

…editing any details (such as the amount of storage) as needed.

By default the volumes will be stored on a single node utilizing hostPath storage under /var/snap/microk8s/common/nfs-storage.

The addon can be disabled at any time with the command:

microk8s disable nfs

I’m using Ubuntu Core 22 on Intel NUC (x86_64). I used this tutorial to build the microk8s cluster.

I’m not able to enable the nfs addon while (I think) I don’t have any nfs-common
installed on my node (the Intel NUC mentionned above). I can only use snap and not apt.

My currently install snaps :

sudo snap list
Name         Version         Rev    Tracking       Publisher   Notes
core         16-2.57.6       14399  latest/stable  canonicalâś“  core
core18       20221212        2667   latest/stable  canonicalâś“  base
core22       20221212        469    latest/stable  canonicalâś“  base
docker       20.10.17        2285   latest/stable  canonicalâś“  -
microk8s     v1.26.0         4393   latest/edge/…  canonical✓  -
nano-strict  5.2+pkg-353f    32     latest/stable  brlin       -
pc           22-0.3          127    22/stable      canonicalâś“  gadget
pc-kernel    5.15.0-53.59.1  1136   22/stable      canonicalâś“  kernel
snapd        2.57.6          17883  latest/stable  canonicalâś“  snapd

How can I install this addon on my node ?