kind: Pod
apiVersion: v1
metadata:
  name: zfs-example
  namespace: zfs-system
spec:
  securityContext:
    #runAsUser: 1000
    fsGroup: 0
    #runAsGroup: 1000
  containers:
  - name: example
    image: busybox
    securityContext:
      runAsUser: 1000
    command:
      - "/bin/sh"
    env:
      - name: DIR
        value: /tmp/pv
      - name: FILE
        value: /tmp/pv/SUCCESS
    args:
      - "-c"
      - "id; mount; ls -lah ${DIR}; sleep 5; date > ${FILE} && chmod +w ${FILE}"
    volumeMounts:
      - name: zfs-volume
        mountPath: "/tmp/pv"
  restartPolicy: "Never"
  volumes:
    - name: zfs-volume
      persistentVolumeClaim:
        claimName: example-nfs
