User Volumes
The simplest way to use local storage is to use user volumes. Once the user volume is created, it is automatically mounted under/var/mnt/u-<user-volume-name> path on the node.
For example, create a configuration patch for a user volume named local-storage:
diskSelector), the user volume will be created and mounted under /var/mnt/u-local-storage path on the node.
/var/mnt/local-storage path in your Kubernetes manifests to refer to the local storage:
Local Path Provisioner
Local Path Provisioner can be used to dynamically provision local storage. First, we will create a separate user volume for the Local Path Provisioner to use. Apply the following machine configuration patch:Note: make sure you have enough space available to provision the user volume.
/var/mnt/local-path-provisioner as the root path for the local storage.
For example, Local Path Provisioner can be installed using kustomize with the following configuration:
kustomization.yaml into a new directory, and run kustomize build | kubectl apply -f - to install Local Path Provisioner to a Talos Linux cluster.
There are three patches applied:
- change default
/opt/local-path-provisionerpath to/var/mnt/local-path-provisioner - make
local-pathstorage class the default storage class (optional) - label the
local-path-storagenamespace as privileged to allow privileged pods to be scheduled there
talosctl ls /var/mnt/local-path-provisioner command.