diff --git a/README.md b/README.md index 038c863..5e3547e 100644 --- a/README.md +++ b/README.md @@ -195,9 +195,65 @@ EOF kubectl get pvc nfs-test ``` -Status should be `Bound`. Clean up: +Status should be `Bound`. + +Test a pod actually writing to it: ```bash +kubectl apply -f - <<'EOF' +apiVersion: v1 +kind: Pod +metadata: + name: nfs-test-pod + namespace: default +spec: + containers: + - name: writer + image: busybox:1.36 + command: ["sh", "-c", "echo hello-from-$(hostname)-$(date -u +%FT%TZ) > /data/test.txt && sleep 3600"] + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: nfs-test +EOF +kubectl wait --for=condition=Ready pod/nfs-test-pod --timeout=60s +kubectl exec nfs-test-pod -- cat /data/test.txt +``` + +Verify data persists across pod delete/recreate (proves it's NFS-backed, not local emptyDir): + +```bash +kubectl delete pod nfs-test-pod +kubectl apply -f - <<'EOF' +apiVersion: v1 +kind: Pod +metadata: + name: nfs-test-pod2 + namespace: default +spec: + containers: + - name: reader + image: busybox:1.36 + command: ["sleep", "3600"] + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: nfs-test +EOF +kubectl wait --for=condition=Ready pod/nfs-test-pod2 --timeout=60s +kubectl exec nfs-test-pod2 -- cat /data/test.txt # same content, different pod +``` + +Clean up: + +```bash +kubectl delete pod nfs-test-pod2 kubectl delete pvc nfs-test ```