How rancher/local-path-provisioner works
Local Path Provisioner is a Kubernetes storage provisioner that creates hostPath- or local-backed persistent volumes using paths configured for each node or storage class. The user submits a PVC and workload; Kubernetes coordinates provisioning, after which the workload can use the bound volume. The daemon loads configuration, runs the provisioner, and uses helper pods to perform volume setup and cleanup. The README also documents shared-filesystem and custom helper-command options. Edges reflect README statements or shown source calls; where runtime dispatch is not shown, the link is marked unverified.
Main entry points: provisioner.go Volume lifecycle · main.go Daemon startup · util.go Helper pod validation
Components 17
Storage workflow
- Storage claim
- Persistent volume
- Pod workload
Daemon runtime
- Daemon startup
main.go - Kubernetes client
main.go - ConfigMap loading
main.go - Readiness checks
main.go - Provisioner controller
main.go
Provisioning policy
- Volume lifecycle
provisioner.go - Path configuration
provisioner.go - Node path selection
provisioner.go
Node operations
- Helper pod validation
util.go - Helper pod execution
provisioner.go - Node-local storage
- Shared filesystem
Other components
- Kubernetes user
- Kubernetes control plane
Connections 21
- Kubernetes user → Storage claim: creates claim
README.md - Kubernetes user → Pod workload: creates pod
README.md - Storage claim → Kubernetes control plane: submits claim
README.md - Kubernetes control plane → Provisioner controller: dispatches request
- Provisioner controller → Volume lifecycle: runs lifecycle
- Volume lifecycle → Persistent volume: creates volume
README.md - Persistent volume → Kubernetes control plane: binds claim
README.md - Pod workload → Persistent volume: uses bound volume
README.md - Daemon startup → Kubernetes client: creates client
main.go - Daemon startup → ConfigMap loading: loads settings
main.go - ConfigMap loading → Kubernetes client: reads ConfigMap
main.go - Daemon startup → Readiness checks: starts checks
main.go - Readiness checks → Kubernetes client: queries resources
main.go - Daemon startup → Provisioner controller: runs controller
main.go - Volume lifecycle → Path configuration: uses configuration
provisioner.go - Volume lifecycle → Node path selection: selects path
provisioner.go - Volume lifecycle → Helper pod execution: creates helper pod
provisioner.go - Helper pod execution → Kubernetes client: creates pod
provisioner.go - Helper pod execution → Node-local storage: sets up or cleans
README.md - Volume lifecycle → Shared filesystem: supports shared paths
README.md - Helper pod validation → Helper pod execution: validates template