local-path-storage: Create ZFS datasets in the host mount namespace.

The setup hook ran `zfs create`/`zfs mount` inside the helper pod, so
the new dataset was mounted only in the helper container's mount
namespace.  Workloads wrote into the parent dataset rpool/var/k8s, and
at the next host reboot the (empty) child dataset was mounted on top,
hiding the data.  This is what wiped Garage's apparent state after the
reboot on 2026-11-03.

Run the helper pod with hostPID and perform all ZFS and filesystem
operations via `nsenter -t 1 -m`, using the host's zfs binary.  Fail
provisioning if the dataset does not end up mounted on the host.

local-path-storage.orig.yaml is a snapshot of the live resources before
this change.  Note that the provisioner (v0.0.19) reads helperPod.yaml
only at startup and must be restarted after changing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Id4e24bf1fca214a25ea207291cb10ff9500869e0
diff --git a/local-path-storage/setup.sh b/local-path-storage/setup.sh
new file mode 100644
index 0000000..aff8c0c
--- /dev/null
+++ b/local-path-storage/setup.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Creates a ZFS dataset per PV.  The helper pod runs with hostPID, and all
+# ZFS and filesystem operations are performed in the host's mount namespace
+# (nsenter -t 1 -m).  Running zfs directly inside the helper container would
+# mount the dataset only inside the container's own mount namespace; the
+# workload would then write into the parent dataset, and the child dataset
+# would shadow that data after the next host reboot.
+set -eu
+
+while getopts "m:s:p:" opt
+do
+    case $opt in
+        p)
+        absolutePath=$OPTARG
+        ;;
+        s)
+        sizeInBytes=$OPTARG
+        ;;
+        m)
+        volMode=$OPTARG
+        ;;
+    esac
+done
+
+host() { nsenter -t 1 -m -- "$@"; }
+
+host zfs create "rpool${absolutePath}"
+host zfs mount "rpool${absolutePath}" 2>/dev/null || :
+host findmnt -n -o SOURCE "${absolutePath}" | grep -qx "rpool${absolutePath}"
+host chmod 0777 "${absolutePath}"