Disable local-path Storage on k3s

Disable local-path Storage on k3s
Photo by Mohammad Saifullah on Unsplash

When you're installing k3s, it provides you the StorageClass "local-path", which is also set as the default StorageClass. This configuration is absolutely fine for a small, single node development cluster, but it is not suitable for a production grade multi-node cluster.

There are now two options after you've setup a custom, production ready StorageClass: change the default to your new StorageClass or delete the local-path StorageClass entirely, as you probably wont use it at all. The latter is the more likely case.

To remove the local-path StorageClass, create in the k3s manifests folder on all your master nodes (/var/lib/rancher/k3s/server/manifests) a new empty file called local-storage.yaml.skip.

As soon as you've created the file, k3s will notice the change and removes the StorageClass, after which you can set your preferred StorageClass as the new default.