Intro
I wanted a lightweight Kubernetes setup for my homelab, so I tested the MicroK8s cluster creation flow from Portainer.
Reference documentation:
This post summarizes the infrastructure layout I used and how I configured persistent storage using NFS CSI.
Infrastructure Layout
I provisioned Ubuntu 24.04 LTS virtual machines on Proxmox:
| Role | Hostname | VM ID | IP |
|---|---|---|---|
| Control Plane | mk8s-cp-0 | 120 | 192.0.2.120 |
| Control Plane | mk8s-cp-1 | 121 | 192.0.2.121 |
| Control Plane | mk8s-cp-2 | 122 | 192.0.2.122 |
| Storage | mk8s-storage-0 | 124 | 192.0.2.124 |
I used the Proxmox helper script to speed up VM creation:
After provisioning, I had to install and enable SSH manually on the hosts:
sudo apt install -y openssh-server
sudo systemctl enable --now ssh
For high availability, all three Kubernetes nodes were configured as control-plane nodes.
Persistent Storage with NFS CSI
To support persistent volumes, I followed the official MicroK8s NFS documentation:
On the storage VM, I exported an NFS share at /srv/microk8s/data.
I initially set broad permissions during setup to avoid UID/GID mismatches while validating the cluster:
sudo chmod 777 /srv/microk8s/data
For production use, I recommend replacing this with explicit ownership and narrower permissions.
NFS StorageClass
I created the following StorageClass for dynamic provisioning:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-csi
provisioner: nfs.csi.k8s.io
parameters:
server: 192.0.2.124
share: /srv/microk8s/data
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
- hard
- nfsvers=4.2