Advanced example

Local Path Provisioner

Simple local storage for Kind + Cloudburst. Dynamically provision volumes on the node filesystem.

Local Path Provisioner provisions volumes on each node's local filesystem. Uses /opt/local-path-provisioner by default. Suitable for dev and single-node workloads.

PVC → Local Path Provisioner → volume on node filesystem
Local Path Provisioner: PVC triggers volume creation on the node's local filesystem.

1. Install

kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.34/deploy/local-path-storage.yaml

2. Create a PVC and Pod

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: local-path-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-path
  resources:
    requests:
      storage: 2Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: volume-test
spec:
  containers:
  - name: workload
    image: busybox:1.36
    command: ["sleep", "infinity"]
    volumeMounts:
    - name: data
      mountPath: /data
  volumes:
  - name: data
    persistentVolumeClaim:
      claimName: local-path-pvc

3. Verify

kubectl apply -f pvc-pod.yaml
kubectl get pvc
kubectl get pv
kubectl exec volume-test -- sh -c "echo local-path-test > /data/test"
kubectl exec volume-test -- cat /data/test

↑ Kind integrations · ↑ Back to examples