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/<user-volume-name> path on the node.
For example, create a configuration patch for a user volume named local-storage:
local-storage.yaml
talosctl directly, see Create a patch for cluster machines for the exact steps.
If there is enough space available on a non-system disk (see diskSelector), the user volume will be created and mounted under /var/mnt/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. The simplest way to do this is to configure user volumes for Local Path Provisioner to use. Apply the following machine configuration patch:Ensure that 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
kustomization.yaml into a new directory, and run this command to install Local Path Provisioner to a Talos Linux cluster.
- 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.