We can configure MicroK8s to use Ceph as its storage. This tutorial assumes you already configured a MicroCeph cluster, if you don't check how to set it up on a single-node cluster or a multi-node cluster.
To connect MicroCeph to our MicroK8s cluster, first we should enable the add-on.
sudo microk8s enable rook-ceph
Once it's enabled it will output the instructions about how to connect to an existing Ceph cluster.
As we are running MicroCeph on the same node, we can run the following command:
sudo microk8s connect-external-ceph
A few seconds later it will output the MicroK8s storage class that's ready to be used.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
ceph-rbd rook-ceph.rbd.csi.ceph.com Delete Immediate true 1s