Microk8s Hostpath FS Usage of PVC Microk8s Hostpath FS Usage of PVC kubernetes kubernetes

Microk8s Hostpath FS Usage of PVC


Since with hostPath your data is stored directly on the worker you won't be able to monitor the usage. Using hostPath has many drawbacks and while its good for testing it should not be used for some prod system. Keeping the data directly on the node is dangerous and in the case of node failure/replacement you will loose it. Other disadvantages are:

  • Pods created from the same pod template may behave differently on different nodes because of different hostPath file/dir contents on those nodes

  • Files or directories created with HostPath on the host are only writable by root. Which means, you either need to run your container process as root or modify the file permissions on the host to be writable by non-root user, which may lead to security issues

  • hostPath volumes should not be used with Statefulsets.

As you already found out it would be good idea to move on from hostPath towards something else.