Asking for help? Comment out what you need so we can get more information to help you!
Cluster information:
Kubernetes version: 1.16.3
Cloud being used: edis.at
Installation method: microk8s
Host OS: ubuntu 18.04
CNI and version:
CRI and version:
The documentation is not clear on how I can configure the storage path.
I enabled the storage with microk8s.enable storage, and by default it uses /var/snap/microk8s/common/default-storage. I would like to change it to /data/, for example, because my root is small (10G). How can I change the pv-volume to be used by the internal registry (microk8s.enable registry)?
I looked around to see how you can override SNAP_COMMON env variable on a per-snap basis, but all the recommendations I found suggested you simply bind mount onto the /var/snap/microk8s/common/default-storage/ path
I take that to mean that you could completely shutdown/disable microk8s, save any data that’s currently in /var/snap/microk8s/common/default-storage/ , then mount your larger partition onto /var/snap/microk8s/common/default-storage/ and restore the previously saved data (if any)
Note that you cannot symlink /var/snap/microk8s/common/default-storage/ to another location, you must use a mount.
I have attempted this by uninstalling microk8s completely, then mounting a folder on a large partition (/dev/sda1)
sudo mount --bind /media/DATA/kubernetes_default_snap_storage/ /var/snap/microk8s/common/default-storage
Then reinstalled microk8s and enabled the registry addon which in turn uses the storage addons and a persistent volume claim of 20 GB with a volume at:
I.e. stop microk8s, edit that file (/var/snap/microk8s/current/args/containerd) to where you want to put the data, then start microk8s. I still had issue of 0 capacity being reported when I first tried this but I believe this was because docker was using overlay2 driver which required XFS formatted partition, so I made a new partiion which was XFS and used this to solve that, now seems to be working.
This does not change the PVC/PV capacity/capacity requests however. It also seems that even after doing this; when I load lots of images into a local registry (enable.registry) extension, then the root drive partition containing snap expands dramatically in size, so I ran into space issues regardless.