Skip to main content

Local Path Provisioner

Purpose: Dynamic local storage provisioner

Version: v0.0.34

Namespace: local-path-storage

Description

Provides dynamic provisioning of PersistentVolumes (PVs) using local storage on each node. Ideal for development and testing environments.

Installation

Installed via ArgoCD from Helm chart: rancher/local-path-provisioner

Configuration

  • Storage Class Name: local-path (default)
  • Provisioner: rancher.io/local-path
  • Volume Mode: Filesystem
  • Reclaim Policy: Delete
  • Binding Mode: WaitForFirstConsumer

Usage

Create a PVC

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-data
namespace: default
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 10Gi

Use in a Pod

apiVersion: v1
kind: Pod
metadata:
name: my-app
namespace: default
spec:
containers:
- name: app
image: nginx
volumeMounts:
- name: data
mountPath: /usr/share/nginx/html
volumes:
- name: data
persistentVolumeClaim:
claimName: my-data

How It Works

  1. User creates a PVC with storageClassName: local-path
  2. Local Path Provisioner creates a directory on a node
  3. A PV is created pointing to that directory
  4. The PV is bound to the PVC
  5. When a pod is scheduled on that node, the directory is mounted

Storage Location

  • Default Path: /opt/local-path-provisioner
  • Location: On each worker node's filesystem
  • Format: pvc-<namespace>-<pvc-name>-<uuid>

Limitations

LimitationDescription
Node AffinityPVs are tied to specific nodes
No ReplicationData loss if node fails
No SnapshotsLocal storage doesn't support snapshots
CapacityLimited by node disk space
warning

Local Path Provisioner is suitable for development/testing. For production, use a replicated storage solution.

Troubleshooting

Check Storage Class

kubectl get storageclass local-path
kubectl describe storageclass local-path

Check PVC Status

kubectl get pvc -A
kubectl describe pvc <name> -n <namespace>

Check Provisioner Logs

kubectl logs -n local-path-storage -l app=local-path-provisioner

Common Issues

  1. PVC pending - No nodes available or insufficient disk space
  2. Pod pending - Pod can't be scheduled on the node with the PV
  3. Disk full - Check node disk usage with df -h